login
A375498
a(1)=1; thereafter, a(n) is the smallest nonnegative integer not yet in the sequence such that the decimal concatenation a(n-1) || a(n) is divisible by n.
1
1, 0, 3, 2, 5, 4, 9, 6, 12, 10, 23, 16, 25, 20, 40, 32, 13, 14, 44, 60, 27, 28, 29, 52, 50, 18, 36, 68, 15, 30, 38, 72, 93, 84, 35, 64, 75, 24, 57, 120, 54, 138, 46, 112, 95, 22, 56, 160, 132, 100, 47, 164, 83, 70, 125, 104, 31, 90, 86, 220, 21, 142, 128, 192
OFFSET
1,3
LINKS
EXAMPLE
For n=2, a(2)=0 because 0 is not yet in the sequence and a(1) || a(2) = 10 is divisible by 2.
For n=3, a(3)!=0 since 0 is already in the sequence, but instead a(3)=3 since concatenation a(2) || a(3) = 03 is divisible by 3.
MAPLE
P:=proc(q) local a, b, k, n; a:=[1, 0, 3]; for n from 4 to q do
for k from 2 do if numboccur(k, a)=0 then b:=a[nops(a)]*10^length(k)+k;
if frac(b/n)=0 then a:=[op(a), k]; break; fi; fi; od; od; print(op(a)); end:
P(64);
PROG
(JavaScript) let a=[1]; console.log("1 1"); let i=0; while(a.length<10000){if(a.includes(i)||(Number(""+a[a.length-1]+i)%(a.length+1)!= 0)){i++; }else{a.push(i); console.log(""+a.length+" "+i); i=0; }} // Dominic McCarty, Sep 03 2024
CROSSREFS
Sequence in context: A364311 A115297 A275900 * A296007 A277437 A339380
KEYWORD
nonn,base,easy
AUTHOR
Paolo P. Lava, Aug 18 2024
STATUS
approved