cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A370362 Numbers k such that any two consecutive decimal digits of k^2 differ by 1 after arranging the digits in decreasing order.

This page as a plain text file.
%I A370362 #15 Feb 24 2024 11:08:20
%S A370362 0,1,2,3,18,24,66,74,152,179,3678,3698,4175,4616,5904,5968,6596,7532,
%T A370362 8082,8559,9024,10128,10278,11826,12363,12543,12582,13278,13434,13545,
%U A370362 13698,14442,14676,14766,15681,15963,16854,17529,17778,18072,19023,19377,19569,19629
%N A370362 Numbers k such that any two consecutive decimal digits of k^2 differ by 1 after arranging the digits in decreasing order.
%C A370362 Numbers k such that k^2 is in A215014. There are 160 terms in this sequence.
%H A370362 Michael S. Branicky, <a href="/A370362/b370362.txt">Table of n, a(n) for n = 1..160</a>
%e A370362 18^2 = 324 consists of the consecutive digits 2, 3 and 4;
%e A370362 24^2 = 576 consists of the consecutive digits 5, 6 and 7;
%e A370362 66^2 = 4356 consists of the consecutive digits 3, 4, 5 and 6;
%e A370362 74^2 = 5476 consists of the consecutive digits 4, 5, 6 and 7.
%o A370362 (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
%o A370362 a(n) = isconsecutive(n^2)
%o A370362 (Python)
%o A370362 from math import isqrt
%o A370362 from sympy.ntheory import digits
%o A370362 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))])
%o A370362 print(afull()) # _Michael S. Branicky_, Feb 23 2024
%Y A370362 Cf. A215014, A370370. Supersequence of A156977.
%Y A370362 The actual squares are given by A370610.
%K A370362 nonn,base,fini,full
%O A370362 1,3
%A A370362 _Jianing Song_, Feb 16 2024