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.

A370611 Largest square such that any two consecutive digits of its base-n expansion differ by 1 after arranging the digits in decreasing order.

This page as a plain text file.
%I A370611 #18 Feb 25 2024 10:53:47
%S A370611 1,1,225,4,38025,751689,10323369,355624164,9814072356,279740499025,
%T A370611 8706730814089,86847500601,11027486960232964,435408094460869201,
%U A370611 18362780530794065025,2492638430009890761,39207739576969100808801,1972312183619434816475625,104566626183621314286288961,13215338757299095309775089
%N A370611 Largest square such that any two consecutive digits of its base-n expansion differ by 1 after arranging the digits in decreasing order.
%C A370611 By definition, a(n) <= Sum_{i=0..n-1} i*n^i = A062813(n). If n is odd and n-1 has an even number of 2s as prime factors, then there are no pandigital squares in base n, so a(n) <= Sum_{i=1..n-1} i*n^(i-1) = A051846(n-1); see A258103.
%C A370611 If n is odd and n-1 has an even 2-adic valuation, then a(n) <= Sum_{i=2..n-1} i*n^(i-2); see A258103. - _Chai Wah Wu_, Feb 25 2024
%e A370611 See the Example section of A370371.
%o A370611 (PARI) isconsecutive(m, n)=my(v=vecsort(digits(m, n))); for(i=2, #v, if(v[i]!=1+v[i-1], return(0))); 1 \\ isconsecutive(k, n) == 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 A370611 a(n) = forstep(m=sqrtint(if(n%2==1 && valuation(n-1, 2)%2==0, n^(n-1) - (n^(n-1)-1)/(n-1)^2, n^n - (n^n-n)/(n-1)^2)), 0, -1, if(isconsecutive(m^2, n), return(m^2)))
%Y A370611 Cf. A215014, A370370, A370610, A258103 (number of pandigital squares in base n).
%Y A370611 The square roots are given by A370371.
%Y A370611 Cf. A062813, A051846.
%K A370611 nonn,base,hard
%O A370611 2,3
%A A370611 _Jianing Song_, Feb 23 2024
%E A370611 a(17)-a(20) from _Michael S. Branicky_, Feb 23 2024
%E A370611 a(21) from _Chai Wah Wu_, Feb 25 2024