login
A296521
Anagrasum integers: integers N that exactly reproduce their set of digits when we form the set of sums of pairs of adjacent digits.
3
190, 1091, 1459, 1900, 1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 2091, 3091, 4091, 5091, 6091, 7091, 7189, 8091, 9091, 9180, 9541, 9817, 10091, 10819, 11082, 12073, 13064, 14055, 15046, 16037, 17028, 18019, 19000, 19001, 19002, 19003, 19004, 19005, 19006, 19007, 19008, 19009, 20091, 20819, 28011, 30091
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
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
Sequence in context: A248995 A258725 A232387 * A223462 A184192 A263523
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Georges Brougnard, Dec 14 2017
STATUS
approved