login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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

Table of n, a(n) for n=0..54.

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: A265403 A215940 A337866 * A082927 A108965 A341002

Adjacent sequences:  A320167 A320168 A320169 * A320171 A320172 A320173

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 28 05:30 EST 2021. Contains 349401 sequences. (Running on oeis4.)