login
Search: a299403 -id:a299403
     Sort: relevance | references | number | modified | created      Format: long | short | data
The sum a(n) + a(n+1) always has at least one digit "1". Lexicographically first such sequence of nonnegative integers without duplicate term.
+10
31
0, 1, 9, 2, 8, 3, 7, 4, 6, 5, 10, 11, 20, 21, 30, 31, 40, 41, 50, 51, 49, 12, 19, 22, 29, 32, 39, 42, 58, 13, 18, 23, 28, 33, 38, 43, 48, 52, 53, 47, 14, 17, 24, 27, 34, 37, 44, 56, 15, 16, 25, 26, 35, 36, 45, 46, 54, 55, 57, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80
OFFSET
0,3
COMMENTS
The sequence starts with a(0) = 0 and is always extended with the smallest integer not yet present that does not lead to a contradiction. The sequence is a permutation of the natural numbers.
Originally the sequence was defined starting with a(1) = 1 and using only positive integers. This leads to the same sequence restricted to positive indices, which yields a permutation of the positive integers. - M. F. Hasler, Feb 28 2018
LINKS
EXAMPLE
1 + 9 = 10; 9 + 2 = 11; 2 + 8 = 10; 8 + 3 = 11; 3 + 7 = 10; 7 + 4 = 11; 4 + 6 = 10; 6 + 5 = 11; etc.
MATHEMATICA
Nest[Append[#, Block[{k = 1}, While[Nand[FreeQ[#, k], DigitCount[k + #[[-1]], 10, 1] > 0], k++]; k]] &, {1}, 98] (* Michael De Vlieger, Feb 22 2018 *)
PROG
(PARI) a(n, f=1, a=0, u=[a])={for(n=a+1, n, f&&if(f==1, print1(a", "), write(f, n-1, " "a)); for(k=u[1]+1, oo, setsearch(u, k)&&next; setsearch(Set(digits(a+k)), 1)&&(a=k)&&break); u=setunion(u, [a]); u[2]==u[1]+1&&u=u[^1]); a} \\ M. F. Hasler, Feb 22 2018
CROSSREFS
Cf. A299952 (different constraint: a(n) + a(n+1) must be substring of concatenation of a(1..n+1)).
Cf. A299970, A299982, ..., A299988, A299969 (nonnegative analog with digit 0, 2, ..., 9), A299971, A299972, ..., A299979 (positive analog with digit 0, 2, ..., 9).
Cf. A299980, A299981, A299402, A299403, A298974, A298975, A299996, A299997, A298978, A298979 for the analog using multiplication: a(n)*a(n+1) has a digit 0, resp. 1, ..., resp. 9.
KEYWORD
nonn,base
AUTHOR
Eric Angelini, Feb 22 2018
EXTENSIONS
Extended to a(0) = 0 by M. F. Hasler, Feb 28 2018
STATUS
approved
Lexicographic first sequence of nonnegative integers such that a(n) + a(n+1) has a digit 9, and no term occurs twice.
+10
21
0, 9, 10, 19, 20, 29, 30, 39, 40, 49, 41, 8, 1, 18, 11, 28, 21, 38, 31, 48, 42, 7, 2, 17, 12, 27, 22, 37, 32, 47, 43, 6, 3, 16, 13, 26, 23, 36, 33, 46, 44, 5, 4, 15, 14, 25, 24, 35, 34, 45, 50, 59, 60, 69, 70, 79, 80, 89, 90, 99, 91, 58, 51, 68, 61, 78, 71, 88, 81, 98, 92, 57, 52, 67, 62, 77, 72, 87, 82, 97, 93, 56, 53, 66, 63, 76, 73, 86, 83, 96, 94
OFFSET
0,2
COMMENTS
A permutation of the nonnegative integers.
It happens that from a(50) = 50 on, this sequence coincides with the variant A299979 (starting at 1 and having only positive terms). Indeed the two sequences have the property that the terms a(0..49) resp. A299979(1..49) exactly contain all numbers from 0 to 49, respectively 1 to 49. - M. F. Hasler, Feb 28 2018
LINKS
MATHEMATICA
Nest[Append[#, Block[{k = 1}, While[Nand[FreeQ[#, k], DigitCount[#[[-1]] + k, 10, 9] > 0], k++]; k]] &, {0}, 90] (* Michael De Vlieger, Mar 01 2018 *)
PROG
(PARI) a(n, f=1, d=9, a=0, u=[a])={for(n=1, n, f&&if(f==1, print1(a", "), write(f, n-1, " "a)); for(k=u[1]+1, oo, setsearch(u, k)&&next; setsearch(Set(digits(a+k)), d)&&(a=k)&&break); u=setunion(u, [a]); u[2]==u[1]+1&&u=u[^1]); a}
CROSSREFS
Cf. A299979 (analog with positive terms), A299957 (analog with digit 1), A299970, A299982, ..., A299988 (digit 0, 2, ..., 8).
Cf. A299980, A299981, A299402, A299403, A298974, A298975, A299996, A299997, A298978, A298979 for the analog using multiplication: a(n)*a(n+1) has a digit 0, resp. 1, ..., resp. 9.
KEYWORD
nonn,base
AUTHOR
M. F. Hasler and Eric Angelini, Feb 22 2018
STATUS
approved
Lexicographic first sequence of positive integers such that a(n)*a(n+1) has a digit 4, and no term occurs twice.
+10
15
1, 4, 6, 7, 2, 12, 17, 20, 21, 14, 3, 8, 5, 9, 16, 15, 23, 18, 13, 11, 22, 19, 24, 10, 34, 26, 29, 36, 39, 32, 27, 35, 40, 31, 37, 38, 28, 30, 47, 42, 44, 33, 43, 48, 50, 49, 46, 51, 54, 41, 45, 52, 57, 25, 56, 58, 53, 65, 62, 55, 59, 60, 64, 61, 63, 66, 67, 68, 69, 70, 71, 74, 73, 75, 72, 76, 79, 82, 77, 84, 81, 80, 78, 83, 88, 85, 97, 86, 87
OFFSET
1,2
COMMENTS
A permutation of the positive integers.
EXAMPLE
a(1) = 1 is the least positive integer, and a(1) has no other constraint to satisfy.
a(2) = 4 is the least positive integer > a(1) = 1 such that a(2)*a(1) = 4 has a digit 4.
a(3) = 6 is the least positive integer not in {1, 4} such that a(3)*a(2) (= 24) has a digit 4: The smaller choices 2, 3 and 5 do not satisfy this.
a(4) = 7 is the least positive integer not in {1, 4, 6} such that a(4)*a(3) (= 42) has a digit 4: All available smaller choices do not satisfy this.
PROG
(PARI) A298974(n, f=1, d=4, a=1, u=[a])={for(n=2, n, f&&if(f==1, print1(a", "), write(f, n-1, " "a)); for(k=u[1]+1, oo, setsearch(u, k)&&next; setsearch(Set(digits(a*k)), d)&&(a=k)&&break); u=setunion(u, [a]); while(#u>1&&u[2]==u[1]+1, u=u[^1])); a}
CROSSREFS
Cf. A299402, A299403, A298975, ..., A298979: analog with digit 2, 3; ..., 9.
Cf. A299957, A299969, ..., A299988 (analog with addition instead of multiplication, and different digits).
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Feb 22 2018
STATUS
approved
Lexicographic first sequence of positive integers such that a(n)*a(n+1) has a digit 9, and no term occurs twice.
+10
15
1, 9, 10, 19, 5, 18, 11, 27, 7, 13, 3, 23, 4, 24, 8, 12, 16, 6, 15, 26, 35, 14, 21, 29, 17, 37, 25, 36, 22, 41, 34, 28, 32, 30, 31, 39, 46, 2, 45, 20, 47, 42, 38, 50, 58, 33, 43, 44, 59, 49, 40, 48, 52, 56, 53, 55, 54, 61, 64, 62, 63, 57, 51, 69, 68, 72, 82, 60, 65, 66, 75, 79, 67, 70, 71, 76, 78, 73, 81, 74, 77, 83, 84, 88, 90, 91, 87, 80, 99
OFFSET
1,2
COMMENTS
A permutation of the positive integers.
EXAMPLE
a(1) = 1 is the least positive integer, and a(1) has no other constraint to satisfy.
a(2) = 9 is the least positive integer > a(1) = 1 such that a(2)*a(1) = 9 has a digit 9.
a(3) = 10 is the least positive integer not in {1, 9} such that a(3)*a(2) (= 90) has a digit 9: The smaller choices 2, ..., 8 does not satisfy this.
a(4) = 19 is the least positive integer not in {1, 9, 10} such that a(4)*a(3) (= 190) has a digit 5: All available smaller choices do not satisfy this.
PROG
(PARI) A298979(n, f=1, d=9, a=1, u=[a])={for(n=2, n, f&&if(f==1, print1(a", "), write(f, n-1, " "a)); for(k=u[1]+1, oo, setsearch(u, k)&&next; setsearch(Set(digits(a*k)), d)&&(a=k)&&break); u=setunion(u, [a]); while(#u>1&&u[2]==u[1]+1, u=u[^1])); a}
CROSSREFS
Cf. A299980, A299981, A299402, A299403, A298974, A298975, A299996, A299997, A298978 : analog with digit 0, 1,..., 8.
Cf. A299957, A299969, ..., A299988 (analog with addition instead of multiplication, and different digits).
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Feb 22 2018
STATUS
approved
Lexicographic first sequence of positive integers such that a(n)*a(n+1) has a digit 2, and no term occurs twice.
+10
15
1, 2, 6, 4, 3, 7, 16, 8, 9, 14, 13, 17, 12, 10, 20, 11, 19, 15, 18, 24, 5, 25, 21, 22, 26, 27, 23, 34, 28, 29, 32, 31, 33, 37, 35, 36, 42, 30, 40, 38, 39, 48, 43, 44, 46, 45, 47, 41, 49, 50, 51, 52, 53, 54, 55, 59, 58, 56, 57, 60, 62, 61, 66, 64, 63, 67, 69, 68, 65, 80, 74, 71, 72, 73, 77, 76, 70, 75, 79, 78, 84, 83, 81, 82, 86, 87, 95, 96, 92
OFFSET
1,2
COMMENTS
A permutation of the positive integers.
LINKS
EXAMPLE
a(1) = 1 is the least positive integer, it has no other requirement to satisfy.
a(2) = 2 is the least positive integer > a(1) = 1, and a(2)*a(1) = 2 has a digit 2.
a(3) = 6 is the least positive integer > a(2) = 2 such that a(3)*a(2) (= 12) has a digit 2: The smaller choices 3, 4 or 5 do not satisfy this.
a(4) = 4 is the least positive integer > a(2) = 2 such that a(4)*a(3) (= 24) has a digit 2: The smaller choice 3 yields 3*6 = 18 and does not satisfy this.
Now, the least available positive integer a(5) = 3 is such that 3*4 = 12, which has again a digit 2. And so on.
MAPLE
N:= 100: # to get a(1)..a(n) where a(n+1) > N
S:= [$2..N]: nS:= N-1:
R:= 1: x:= 1; found:= true;
while found do
found:= false;
for i from 1 to nS do
if member(2, convert(S[i]*x, base, 10)) then
found:= true;
x:= S[i];
R:= R, x;
S:= subsop(i=NULL, S);
nS:= nS-1;
break
fi
od
od:
R; # Robert Israel, Feb 12 2023
PROG
(PARI) a(n, f=1, d=2, a=1, u=[a])={for(n=2, n, f&&if(f==1, print1(a", "), write(f, n-1, " "a)); for(k=u[1]+1, oo, setsearch(u, k)&&next; setsearch(Set(digits(a*k)), d)&&(a=k)&&break); u=setunion(u, [a]); while(#u>1&&u[2]==u[1]+1, u=u[^1])); a}
CROSSREFS
Cf. A299403, A298974, ..., A298979 (analog with digit 3, ..., 9).
Cf. A299957, A299969, ..., A299988 (analog with addition instead of multiplication, and different digits).
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Feb 22 2018
STATUS
approved
Lexicographic first sequence of nonnegative integers such that a(n) + a(n+1) has a digit 0, and no term occurs twice.
+10
13
0, 10, 20, 30, 40, 50, 51, 9, 1, 19, 11, 29, 21, 39, 31, 49, 41, 59, 42, 8, 2, 18, 12, 28, 22, 38, 32, 48, 52, 53, 7, 3, 17, 13, 27, 23, 37, 33, 47, 43, 57, 44, 6, 4, 16, 14, 26, 24, 36, 34, 46, 54, 55, 5, 15, 25, 35, 45, 56, 64, 66, 74, 76, 84, 86, 94, 96, 104
OFFSET
0,2
COMMENTS
It happens that from a(18) = 42 on, the sequence coincides with the "strictly positive variant" A299971. Indeed, n = 18 is the first index for which the same value occurs, and {a(n), 0 <= n < 18} = {0} U {A299971(n), 1 <= n < 18}. - M. F. Hasler, Feb 28 2018
MATHEMATICA
Nest[Append[#, Block[{k = 1}, While[Nand[FreeQ[#, k], DigitCount[#[[-1]] + k, 10, 0] > 0], k++]; k]] &, {0}, 67] (* Michael De Vlieger, Mar 01 2018 *)
PROG
(PARI) a(n, f=1, d=0, a=0, u=[a])={for(n=1, n, f&&if(f==1, print1(a", "), write(f, n-1, " "a)); for(k=u[1]+1, oo, setsearch(u, k)&&next; setsearch(Set(digits(a+k)), d)&&(a=k)&&break); u=setunion(u, [a]); u[2]==u[1]+1&&u=u[^1]); a}
CROSSREFS
Cf. A299971 (analog with positive terms), A299957 (digit 1), A299972..A299979 (digit 2..9).
Cf. A299980, A299981, A299402, A299403, A298974, A298975, A299996, A299997, A298978, A298979 for an analog using multiplication: a(n)*a(n+1) has a digit 0, resp. 1, ..., resp. 9.
KEYWORD
nonn,base
AUTHOR
M. F. Hasler and Eric Angelini, Feb 22 2018
STATUS
approved
Lexicographic first sequence of positive integers such that a(n)*a(n+1) has a digit 5, and no term occurs twice.
+10
10
1, 5, 3, 15, 7, 8, 19, 24, 21, 12, 13, 4, 14, 11, 23, 22, 16, 32, 17, 9, 6, 25, 2, 26, 20, 27, 28, 18, 29, 33, 35, 10, 45, 30, 50, 31, 34, 37, 41, 38, 40, 39, 55, 43, 36, 42, 49, 44, 57, 62, 46, 56, 51, 52, 53, 48, 47, 54, 64, 68, 67, 59, 60, 75, 58, 61, 65, 63, 66, 69, 73, 70, 72, 71, 74, 76, 77, 85, 79, 83, 91, 94, 80, 82, 86, 88, 87, 95, 81
OFFSET
1,2
COMMENTS
A permutation of the positive integers.
EXAMPLE
a(1) = 1 is the least positive integer, and a(1) has no other constraint to satisfy.
a(2) = 5 is the least positive integer > a(1) = 1 such that a(2)*a(1) = 5 has a digit 5.
a(3) = 3 is the least positive integer not in {1, 5} such that a(3)*a(2) (= 15) has a digit 5: The smaller choice 2 does not satisfy this.
a(4) = 15 is the least positive integer not in {1, 3, 5} such that a(4)*a(3) (= 75) has a digit 5: All available smaller choices do not satisfy this.
PROG
(PARI) A298975(n, f=1, d=5, a=1, u=[a])={for(n=2, n, f&&if(f==1, print1(a", "), write(f, n-1, " "a)); for(k=u[1]+1, oo, setsearch(u, k)&&next; setsearch(Set(digits(a*k)), d)&&(a=k)&&break); u=setunion(u, [a]); while(#u>1&&u[2]==u[1]+1, u=u[^1])); a}
CROSSREFS
Cf. A299402, A299403, A298974, ..., A298979: analog with digit 2, 3; ..., 9.
Cf. A299957, A299969, ..., A299988 (analog with addition instead of multiplication, and different digits).
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Feb 22 2018
STATUS
approved
Lexicographic first sequence of positive integers such that a(n) + a(n+1) has a digit 0, and no term occurs twice.
+10
10
1, 9, 11, 19, 21, 29, 31, 39, 41, 49, 51, 50, 10, 20, 30, 40, 60, 42, 8, 2, 18, 12, 28, 22, 38, 32, 48, 52, 53, 7, 3, 17, 13, 27, 23, 37, 33, 47, 43, 57, 44, 6, 4, 16, 14, 26, 24, 36, 34, 46, 54, 55, 5, 15, 25, 35, 45, 56, 64, 66, 74, 76, 84, 86, 94, 96, 104, 97
OFFSET
1,2
COMMENTS
It happens that from a(18) = 42 on, the sequence coincides with the "nonnegative variant" A299970. Indeed, n = 18 is the first index for which the same value occurs, and {a(n), 1 <= n < 18} U {0} = {A299970(n), 0 <= n < 18}. - M. F. Hasler, Feb 28 2018
LINKS
MATHEMATICA
Nest[Append[#, Block[{k = 1}, While[Nand[FreeQ[#, k], DigitCount[k + #[[-1]], 10, 0] > 0], k++]; k]] &, {1}, 67] (* Michael De Vlieger, Feb 22 2018 *)
PROG
(PARI) a(n, f=1, d=0, a=1, u=[a])={for(n=2, n, f&&if(f==1, print1(a", "), write(f, n-1, " "a)); for(k=u[1]+1, oo, setsearch(u, k)&&next; setsearch(Set(digits(a+k)), d)&&(a=k)&&break); u=setunion(u, [a]); u[2]==u[1]+1&&u=u[^1]); a}
CROSSREFS
Cf. A299970 (analog with nonnegative terms), A299957 (analog with digit 1), A299972 .. A299979 (digit 2..9).
Cf. A299980, A299981, A299402, A299403, A298974, A298975, A299996, A299997, A298978, A298979 for the analog using multiplication: a(n)*a(n+1) has a digit 0, resp. 1, ..., resp. 9.
KEYWORD
nonn,base
AUTHOR
M. F. Hasler and Eric Angelini, Feb 22 2018
STATUS
approved
Lexicographic first sequence of positive integers such that a(n)*a(n+1) has a digit 6, and no term occurs twice.
+10
10
1, 6, 10, 16, 4, 9, 7, 8, 2, 3, 12, 5, 13, 20, 18, 17, 28, 22, 21, 26, 11, 15, 24, 14, 19, 32, 23, 27, 25, 64, 29, 34, 39, 35, 36, 31, 44, 37, 38, 42, 30, 52, 33, 49, 40, 41, 43, 48, 45, 57, 46, 47, 56, 51, 60, 61, 65, 71, 53, 50, 72, 55, 63, 58, 62, 59, 54, 66, 70, 67, 68, 69, 74, 76, 79, 73, 77, 78, 80, 75, 81, 82, 83, 84, 89, 85, 90, 94, 92
OFFSET
1,2
COMMENTS
A permutation of the positive integers.
EXAMPLE
a(1) = 1 is the least positive integer, and a(1) has no other constraint to satisfy.
a(2) = 6 is the least positive integer > a(1) = 1 such that a(2)*a(1) = 6 has a digit 6.
a(3) = 10 is the least positive integer not in {1, 6} such that a(3)*a(2) (= 60) has a digit 6: All smaller choices (2, 3, 4 or 5) do not satisfy this.
a(4) = 16 is the least positive integer not in {1, 6, 10} such that a(4)*a(3) (= 160) has a digit 6: All smaller choices 2,...,15 do not satisfy this.
PROG
(PARI) A299996(n, f=1, d=6, a=1, u=[a])={for(n=2, n, f&&if(f==1, print1(a", "), write(f, n-1, " "a)); for(k=u[1]+1, oo, setsearch(u, k)&&next; setsearch(Set(digits(a*k)), d)&&(a=k)&&break); u=setunion(u, [a]); while(#u>1&&u[2]==u[1]+1, u=u[^1])); a}
CROSSREFS
Cf. A299402, A299403, A298974, ..., A298979, A299997: analog with digit 2, 3, ..., 9, 7.
Cf. A299957, A299969, ..., A299988 (analog with addition instead of multiplication, and different digits).
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Feb 22 2018
STATUS
approved
Lexicographic first sequence of positive integers such that a(n)*a(n+1) has a digit 7, and no term occurs twice.
+10
10
1, 7, 10, 17, 11, 16, 36, 2, 35, 5, 14, 27, 21, 13, 6, 12, 23, 9, 3, 19, 4, 18, 15, 25, 28, 24, 30, 26, 22, 8, 34, 50, 54, 31, 37, 20, 38, 44, 29, 33, 39, 43, 32, 46, 45, 55, 65, 42, 41, 47, 51, 53, 49, 56, 62, 48, 57, 61, 52, 63, 59, 64, 58, 72, 66, 83, 69, 40, 68, 70, 71, 67, 81, 75, 73, 79, 60, 95, 74, 78, 86, 82, 85, 84, 80, 88, 77, 91, 87
OFFSET
1,2
COMMENTS
A permutation of the positive integers.
EXAMPLE
a(1) = 1 is the least positive integer, and a(1) has no other constraint to satisfy.
a(2) = 7 is the least positive integer > a(1) = 1 such that a(2)*a(1) = 7 has a digit 7.
a(3) = 10 is the least positive integer not in {1, 7} such that a(3)*a(2) (= 70) has a digit 7: All smaller choices (2, ..., 6) do not satisfy this.
a(4) = 17 is the least positive integer not in {1, 7, 10} such that a(4)*a(3) (= 170) has a digit 7: All smaller choices 2,...,16 do not satisfy this.
PROG
(PARI) A299997(n, f=1, d=7, a=1, u=[a])={for(n=2, n, f&&if(f==1, print1(a", "), write(f, n-1, " "a)); for(k=u[1]+1, oo, setsearch(u, k)&&next; setsearch(Set(digits(a*k)), d)&&(a=k)&&break); u=setunion(u, [a]); while(#u>1&&u[2]==u[1]+1, u=u[^1])); a}
CROSSREFS
Cf. A299402, A299403, A298974, ..., A298979, A299996: analog with digit 2, 3, 4, ..., 9, 6.
Cf. A299957, A299969, ..., A299988 (analog with addition instead of multiplication, and different digits).
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Feb 22 2018
STATUS
approved

Search completed in 0.009 seconds