A249405 Numbers such that any two adjacent digits sum to a prime and such that any digit 0,...,9 can be inserted somewhere preserving this property.
411203, 411205, 3202114, 4111203, 4111205, 4112023, 4112025, 5202114, 30211234, 30232114, 30234114, 30252114, 30256114, 32021114, 32032114, 32034114, 32052114, 32056114, 32074114, 32076114, 32112034, 32112074, 32302114, 32502114, 41111203
Offset: 1
Examples
a(n)=411203 is the least member of A182175 such that each of the digits 0-9 can be inserted somewhere such that another term of A182175 is obtained; e.g., 411203[0], 41[1]1203, 41[2]1203, 4112[3]03, 41[4]1203, 4112[5]03, 41[6]1203, [7]411203, 411203[8], [9]411203.
Links
- M. F. Hasler, Table of n, a(n) for n = 1..124
Programs
-
PARI
is(n)={is_A182175(n)||return; n=digits(n); !for(D=0,9,isprime(n[#n]+D)&&next;D&&isprime(n[1]+D)&&next;for(i=3-!D,#n-1,isprime(n[i-1]+D)&&isprime(n[i]+D)&&next(2));return)} \\ A digit D=0 may not be prefixed but may be inserted after the first digit (which is irrelevant for digits > 0).
Extensions
Data and b-file corrected thanks to a remark by Hans Havermann, M. F. Hasler, Oct 29 2014
Comments