WSQ08 Yo soy 196

--Originally published at Programación Orientada a Objetos

Para entender este programa primero tenemos que entender que son los números palíndromos y los Lychrel.

Los números palíndromos son por ejemplo los números 11, 121, 77, 565, ya que todos estos se leen igual normales y volteados.  Pero también son palíndromos cuando por ejemplo pasa esto: 13 + 31 = 44 entonces también se formará un número palindromo.

Los números Lychrel al contrario, son los números que no importa cuantas veces los sumes, no se harán palíndromos en algún momento.

WSQ08 Yo soy 196

 


WSQ08 Yo soy 196

WSQ08 YoSoy196

--Originally published at GilbertoRogel

Hardest WSQ so far, took me 2 days to realize i couldn't do it by myself so i got help from other peoples blogs and for me the most complete was this : richardctc201 blog

At first it was a bit confusing but with Richard's explanation on his blog it became more clear what i had to do.

Link to my code: YoSoy196

Pictures:

Lower boundLower Bound

Upper BoundUpper Bound

Result

Results

Gilberto Rogel García A01630171

//

WSQ08 – Yo Soy 196

--Originally published at JAVALIO

Second time I face this problem, last time I was programming in Python, now is Java.

Yo soy 196, is about Palindrome, and Lychrel Number, is simple there exists palindrome(things that reads the same way left to rigth and otherwise) example rotator, reviver, denned, sexes, etc.

There also exist Palindrome number like 11, 22,33,44,55..(this are called Natural Palindrome, because by nature they can be read right to left and othewise), others numbers like 12 are palindrome but not for its nature, we need to add their inverse in order to find the Palindrome, 12 + 21 = 33, now 33 is palindrome but there are some numbers that we cannot find if they become palindrome after many iterations, these are called Lychrel Number the first example is 196 the first number that cannot be proved that reach a Palindrome

So our programm what do is receives a range and look for natural Palindromes, Palindromes after addinig, and candydates Lychrel numbers.

My codes in Github:

https://github.com/cesarau04/WSQ-Java/blob/master/WSQ08.java (main)

https://github.com/cesarau04/WSQ-Java/blob/master/MyRange.java (class MyRange)

Image by Eva the Weaver


WSQ08 – Yo Soy 196

WSQ08 – Yo Soy 196

--Originally published at JAVALIO

Second time I face this problem, last time I was programming in Python, now is Java.

Yo soy 196, is about Palindrome, and Lychrel Number, is simple there exists palindrome(things that reads the same way left to rigth and otherwise) example rotator, reviver, denned, sexes, etc.

There also exist Palindrome number like 11, 22,33,44,55..(this are called Natural Palindrome, because by nature they can be read right to left and othewise), others numbers like 12 are palindrome but not for its nature, we need to add their inverse in order to find the Palindrome, 12 + 21 = 33, now 33 is palindrome but there are some numbers that we cannot find if they become palindrome after many iterations, these are called Lychrel Number the first example is 196 the first number that cannot be proved that reach a Palindrome

So our programm what do is receives a range and look for natural Palindromes, Palindromes after addinig, and candydates Lychrel numbers.

My codes in Github:

https://github.com/cesarau04/WSQ-Java/blob/master/WSQ08.java (main)

https://github.com/cesarau04/WSQ-Java/blob/master/MyRange.java (class MyRange)

Image by Eva the Weaver


WSQ08 – Yo Soy 196

Gunning down 195 numbers

--Originally published at richardctc201

Finally I got to the final task of the first partial: the 196 activity. This activity consisted in creating a program to find possible Lychrel numbers in a specific range of data. Lychrel numbers are natural numbers that do not form palindromes after adding their inverse several times.

As usual, I asked for help to my new best friend Alex, and here is what he did: obviously (like in every previous programs) I created two classes, the main class and an additional class called ‘Range’. In my main class, I used a new thing (well, new for me) called JOptionPane to collect inputs given by the user. I had two of this so that the user could enter the lower and the upper limits of the range of numbers. In Range, I defined 5 variables: low, high, natural=0, non=0, and yes=0. I also created two methods: the first one called ‘rango’ (I’m Mexican so don’t nag me) that has two parameters a and b where a is defined as the lower bound, and b as the upper bound; the second one was the method where all the math calculations were made, this one was called ‘types’.

In main, I created one new object, and called method rango for it, passing the two inputs provided by the user as parameters.  In types, I defines two variables (both strings): palin, and palinInverse, both variables were empty. I also defines 4 varibales as long: p1, p2, suma, and n. Finally I created a For loop with the condition that x=lower bound, and it iterate until x=upperbound. In the for loop, I made three conditions: one if that add one to my variable ‘natural’ if the number was a natural palindrome; another for loop to iterate thirty times to find Lychrel candidates, if there were palindromes in the way, it add one to ‘non’, and if not, it print an “Alert message” and add one to ‘yes’ meaning that it had found a Lychrel candidate.

I had a little problem with this code because first I defined my variables as float, but after just 10 iterations the numbers were incredibly huge, and the float variables couldn’t support it. So I had to change my variables to long, and then the program could successfully run.

Here I leave screens of my program in Github:

Gunning down 195 numbers

Gunning down 195 numbers


Gunning down 195 numbers

My sleep, my WSQs

--Originally published at Social coding

This one was very tricky, for reversing the number I needed to look on the other people code. I found one method that I thought was brilliant.
It was fun making this. I should write more, but I need to sleep.

My sleep, my WSQs

My sleep, my WSQs

My sleep, my WSQs

Will update it with images and a topic later this week.
I will write about business models in the software industry.


My sleep, my WSQs