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!)
A345338 Integers whose Reverse And Add trajectory reaches its first prime after a record number of iterations (at least one iteration must be performed). 0
1, 5, 181, 10031, 1001320 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

a(6) > 10^9 (if it exists).

All numbers whose trajectory reaches a multiple of 3 or 11 before reaching a prime will never reach a prime.

LINKS

Table of n, a(n) for n=1..5.

EXAMPLE

a(3) = 181 because it takes 3 iterations (181 -> 362 -> 625 -> 1151 (prime)) to reach a prime, which is more than any smaller number.

PROG

(PARI) f(n) = my(t=n, c=1); while(!isprime(t+=fromdigits(Vecrev(digits(t)))), if(gcd(t, 33)>1, return(0)); c++); c;

lista(nn) = my(m); for(k=1, nn, if(f(k)>m, print1(k, ", "); m=f(k))); \\ Jinyuan Wang, Jun 15 2021

(Python)

from sympy import isprime

def ra(n): s = str(n); return int(s) + int(s[::-1])

def afind(limit):

    record = 0

    for k in range(limit+1):

        m, i = ra(k), 1

        while not isprime(m) and m%3 != 0 and m%11 != 0: m = ra(m); i += 1

        if isprime(m) and i > record: record = i; print(k, end=", ")

afind(1234567) # Michael S. Branicky, Jul 03 2021

CROSSREFS

Cf. A056964.

Sequence in context: A027572 A050239 A218690 * A256286 A304277 A208403

Adjacent sequences:  A345335 A345336 A345337 * A345339 A345340 A345341

KEYWORD

nonn,base,more

AUTHOR

Daniel Starodubtsev, Jun 14 2021

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 October 25 17:22 EDT 2021. Contains 348255 sequences. (Running on oeis4.)