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!)
A088788 Numbers that are primes and remain prime for four successive applications of incrementing each digit by 2 with carries ignored. 3
227, 449, 8669, 8849, 66449, 86627, 8886649, 8888449, 8888669, 8888849, 86664427, 888886447, 888888449 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Imagine that each digit of n is on a wheel on a combination lock and each wheel is being rotated two notches for each application of the function. Thus for the digits 0 to 7, the replacement digit is simply the digit+2, but for 8 the replacement digit is 0 and for 9 the replacement digit is 1. Thus 227 -> 449 -> 661 -> 883 -> 5 (initial zeros are dropped on results.) Note: 227, 86627 and 86664427 also work for *five* successive applications of the function. I have not found any primes that work for six applications of the function.
LINKS
EXAMPLE
a(3)=227 because (i) 227 is prime and (ii) incrementing each digit of 227 by 2 yields 449 which is prime and (iii) incrementing each digit of 449 by 2 (ignoring carries) yields 661, which is prime and (iv) incrementing each digit of 661 by 2 yields 883, which is prime and (v) incrementing each digit of 883 by 2 yields 5 (initial zeros are dropped), which is prime.
MATHEMATICA
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 2; Do[ If[ Union[ PrimeQ[ NestList[ FromDigits[ Mod[ IntegerDigits[ # ] + 2, 10]] &, p, 4]]] == {True}, Print[p]]; p = NextPrim[p], {n, 1, 10^9}] (* Robert G. Wilson v, Nov 01 2003 *)
PROG
Function Cycle222(long: p): long {i: integer; r: long; c: integer; for i=floor(log10(p)) to 0 step -1; c = floor(p/10^(i-1)) mod 10; r = r*10 + ((c+2) mod 10); next i; return r; } p=2; for i=1 to 90; n=sequence.count; do while sequence.count=n; j=cycle222(p); k=cycle222(j); m=cycle222(k); if isprime(j) and isprime(k) and isprime(m) and isprime(cycle222(m)) then sequence.add(p) else p=nextPrimeAfter(p); loop; next i;
CROSSREFS
Sequence in context: A210513 A142842 A142545 * A142390 A142219 A176012
KEYWORD
base,nonn
AUTHOR
Chuck Seggelin (barkeep(AT)plastereddragon.com), Oct 16 2003
EXTENSIONS
More terms from Robert G. Wilson v, Nov 01 2003
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 September 7 23:15 EDT 2024. Contains 375749 sequences. (Running on oeis4.)