login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A320170 Every pair of consecutive numbers sums to a palindrome, starting with a(0)=1; a(1)=10, and taking a(n) = smallest number > a(n-2). 0
1, 10, 12, 21, 23, 32, 34, 43, 45, 54, 47, 64, 57, 74, 67, 84, 77, 94, 87, 104, 98, 114, 108, 124, 118, 134, 128, 144, 138, 154, 149, 164, 159, 174, 169, 184, 179, 194, 189, 204, 200, 214, 210, 224, 220, 234, 230, 244, 240, 254, 251, 264, 261, 274, 271 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
MATHEMATICA
Nest[Append[#, Block[{k = #[[-2]] + 1}, While[! PalindromeQ[#[[-1]] + k], k++]; k]] &, {1, 10}, 53] (* Michael De Vlieger, Oct 10 2018 *)
PROG
(Python)
CurrentNum=10
PreviousNum=1
NewNum=0
def NextPalindrome(StartNum):
FoundNext=0
t=0
n=0
Number=0
Lastdigit=0
while FoundNext<=PreviousNum:
n=n+1
t=StartNum+n
Number=t
Reverse=0
while Number>0:
Lastdigit=Number%10
Reverse=(Reverse*10)+Lastdigit
Number=Number//10
if t==Reverse:
FoundNext=n
return n
print(1)
print(10)
for x in range(50):
NewNum=NextPalindrome(CurrentNum)
print(NewNum)
PreviousNum=CurrentNum
CurrentNum=NewNum
CROSSREFS
Cf. A062932.
For n < 10, equals A061870 and A175885.
Sequence in context: A368550 A337866 A357045 * A082927 A108965 A366958
KEYWORD
nonn,easy,base
AUTHOR
Jim Singh, Oct 07 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 11:45 EDT 2024. Contains 371278 sequences. (Running on oeis4.)