OFFSET
1,3
COMMENTS
Numbers k such that k^2 is in A215014. There are 160 terms in this sequence.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..160
EXAMPLE
18^2 = 324 consists of the consecutive digits 2, 3 and 4;
24^2 = 576 consists of the consecutive digits 5, 6 and 7;
66^2 = 4356 consists of the consecutive digits 3, 4, 5 and 6;
74^2 = 5476 consists of the consecutive digits 4, 5, 6 and 7.
PROG
(PARI) isconsecutive(m, {b=10})=my(v=vecsort(digits(m, b))); for(i=2, #v, if(v[i]!=1+v[i-1], return(0))); 1 \\ isconsecutive(k, b) == 1 if and only if any two consecutive digits of the base-n expansion of m differ by 1 after arranging the digits in decreasing order
a(n) = isconsecutive(n^2)
(Python)
from math import isqrt
from sympy.ntheory import digits
def afull(): return([i for i in range(isqrt(10**10)+1) if len(d:=sorted(str(i*i))) == ord(d[-1])-ord(d[0])+1 == len(set(d))])
print(afull()) # Michael S. Branicky, Feb 23 2024
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
Jianing Song, Feb 16 2024
STATUS
approved