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.

A287298 a(n) is the largest square with distinct digits in base n.

This page as a plain text file.
%I A287298 #11 May 24 2017 13:08:59
%S A287298 1,1,225,576,38025,751689,10323369,355624164,9814072356,279740499025,
%T A287298 8706730814089,23132511879129,11027486960232964,435408094460869201,
%U A287298 18362780530794065025,48470866291337805316,39207739576969100808801,1972312183619434816475625,104566626183621314286288961
%N A287298 a(n) is the largest square with distinct digits in base n.
%C A287298 a(n) does not always have n digits in base n. If n is 5 mod 8 then a number which contains all the digits in base n is congruent to (n-1)n/2 mod (n-1). It will be then divisible by a single power of 2 and not a square.
%C A287298 a(22) = 340653564758245010607213613056. - _Chai Wah Wu_, May 24 2017
%e A287298 a(4)=225 which is 3201 in base 4. Higher squares have at least 5 digits in base 4.
%o A287298 (Python)
%o A287298 from gmpy2 import isqrt, mpz, digits
%o A287298 def A287298(n): # assumes n <= 62
%o A287298     m = isqrt(mpz(''.join(digits(i,n) for i in range(n-1,-1,-1)),n))
%o A287298     m2 = m**2
%o A287298     d = digits(m2,n)
%o A287298     while len(set(d)) < len(d):
%o A287298         m -= 1
%o A287298         m2 -= 2*m+1
%o A287298         d = digits(m2,n)
%o A287298     return int(m2) # _Chai Wah Wu_, May 24 2017
%K A287298 nonn,base
%O A287298 2,3
%A A287298 _John L. Drost_, May 22 2017
%E A287298 Added a(16)-a(20) and corrected a(12) by _Chai Wah Wu_, May 24 2017