login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


A345680
Nonnegative integers whose trajectory under iteration of taking the absolute value of the alternating sum of the squares of the digits (A257588) includes zero.
1
0, 7, 11, 22, 29, 33, 34, 38, 43, 44, 47, 49, 55, 56, 59, 65, 66, 70, 74, 77, 83, 88, 92, 94, 95, 99, 108, 110, 117, 125, 126, 131, 138, 142, 147, 148, 149, 161, 168, 171, 172, 179, 182, 184, 185, 195, 196, 205, 212, 220, 227, 234, 237, 238, 241, 258, 265, 269
OFFSET
1,2
COMMENTS
The sequence was initially studied by a group of students at Clifton College, UK.
There are infinitely many terms.
Having checked up to 10^10, there are approximations for the lower and upper density: 0.23 and 0.25 respectively.
Conjecture: there are strings of consecutive terms of arbitrary length.
Any number which is formed by concatenating two-digit multiples of 11 is a term.
EXAMPLE
For 7, the trajectory under iteration is 7, 49, 65, 11, 0, ..., so 7 is a term.
For 11, the trajectory is 11, 0, ...
For 22, the trajectory is 22, 0, ...
For 29, the trajectory is 29, 77, 0, ...
A non-example is 48. Its trajectory is 48, 48, ...
MATHEMATICA
Select[Range[1000], FixedPoint[ Abs[Sum[(-1)^(n + 1)*Part[IntegerDigits[#]^2, n], {n, 1, Length[IntegerDigits[#]]}]] &, #, 10] == 0 &] (* Luca Onnis, Feb 23 2022 *)
PROG
(Python)
def happyish_function(number, base: int = 10): # A257588
# iterates the process
total = 0
times = 0
while number > 0:
total += pow(-1, times) * pow(abs(number) % base, 2)
number = abs(number) // base
times += 1
return abs(total)
def is_happyish(number: int) -> bool:
# determines whether a number is happyish
seen_numbers = set()
while number > 0 and number not in seen_numbers:
seen_numbers.add(number)
number = happyish_function(number)
return number == 0
def happyish_list(number: int):
# creates their list
happyish = []
n = 0
for i in range(number):
if is_happyish(i) == True:
n +=1
happyish.append(i)
return happyish
happyish_list(100) # an example
CROSSREFS
Cf. A257588 (iteration step).
Cf. A007770 (sum of squares not alternating).
Sequence in context: A259260 A081352 A190673 * A175651 A372045 A362979
KEYWORD
nonn,base
AUTHOR
Stephen Cross, Jun 23 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 22 19:23 EDT 2024. Contains 376138 sequences. (Running on oeis4.)