[go: up one dir, main page]

login
A380690
a(0) = 0; a(n) = the number of times a(n-1) has all digits in common with a previous term.
1
0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 0, 11, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 12, 0, 12, 1, 13, 0, 13, 1, 14, 0, 14, 1, 15, 0, 15, 1, 16, 0, 16, 1, 17, 0, 17, 1, 18, 0, 18, 1, 19, 0, 19, 1, 20, 0, 20, 1, 21
OFFSET
0,5
COMMENTS
Every number should appear a limited number of times in the sequence as opposed as in A326834.
EXAMPLE
a(24) = 2 since a(23) = 1 and previously there are two numbers that only have the digit '1': a(22) = 11 and a(2) = 1.
a(4062) = 113 since a(4061) = 112 and previously there are 113 occurrences of numbers that only have the digits '1' and '2' such as 12,21,112,121,122.
MATHEMATICA
a[0] = 0; a[n_] := a[n] = Count[Array[a, n - 1, 0], _?(Union[IntegerDigits[a[n - 1]]] == Union[IntegerDigits[#]] &)]; Array[a, 100, 0] (* Amiram Eldar, Jan 30 2025 *)
PROG
(Python)
from collections import Counter
from itertools import count, islice
def agen(): # generator of terms
an, digsetcount = 0, Counter()
while True:
yield an
key = "".join(sorted(set(str(an))))
an = digsetcount[key]
digsetcount[key] += 1
print(list(islice(agen(), 80))) # Michael S. Branicky, Jan 30 2025
CROSSREFS
KEYWORD
nonn,base,new
AUTHOR
Sergio Pimentel, Jan 30 2025
STATUS
approved