OFFSET
1,1
COMMENTS
The sequence is infinite, since a term ending in zero can be extended with as many zeros as needed. The name "anagrasum numbers" comes from "anagram by sum". The "anagraprod numbers" are A296451.
LINKS
Georges Brougnard, Table of n, a(n) for n = 1..421
EXAMPLE
190 reproduces the digits 1, 9 and 0 (in a different order) when the sums 1+9=10 and 9+0=9 are taken. The same with 12073, for instance, which reproduces the digits 1, 2, 0, 7 and 3 when the sums 1+2=3, 2+0=2, 0+7=7 and 7+3=10 are formed.
MATHEMATICA
Select[Range[32000], Function[d, Sort@ Flatten@ Map[IntegerDigits[Total@ #] &, Partition[d, 2, 1]] == Sort@ d]@ IntegerDigits@ # &] (* Michael De Vlieger, Dec 14 2017 *)
PROG
(Python)
def ok(n):
s = str(n)
d = list(map(int, s))
sums = [d[i]+d[i+1] for i in range(len(s)-1)]
return sorted(s) == sorted("".join(str(t) for t in sums))
print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Nov 27 2024
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Georges Brougnard, Dec 14 2017
STATUS
approved