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.

A071176 Smallest k such that the concatenation of n and k is a square (decimal notation).

This page as a plain text file.
%I A071176 #28 Sep 03 2023 10:38:07
%S A071176 6,5,6,9,29,4,29,1,61,0,56,1,69,4,21,9,64,49,6,25,16,5,104,336,6,244,
%T A071176 225,9,16,25,36,4,64,81,344,1,21,44,69,0,209,25,56,1,369,24,61,4,284,
%U A071176 41,84,9,29,76,225,25,6,564,29,84,504,5,504
%N A071176 Smallest k such that the concatenation of n and k is a square (decimal notation).
%C A071176 a(n) = 1 correspond to n = A132356(m), m > 0. - _Bill McEachen_, Aug 31 2023
%H A071176 Reinhard Zumkeller, <a href="/A071176/b071176.txt">Table of n, a(n) for n = 1..10000</a>
%F A071176 A000196(n . a(n)) = A071177(n) where "." stands for concatenation.
%e A071176 a(5) = 29 as 529 = 23^2 and 5'i is nonsquare for i<29, A071177(5)=23.
%t A071176 nksq[n_]:=Module[{idn=IntegerDigits[n],k=0},While[!IntegerQ[Sqrt[ FromDigits[Join[ idn,IntegerDigits[k]]]]],k++];k]; Array[nksq,70] (* _Harvey P. Dale_, Sep 28 2012 *)
%o A071176 (Haskell)
%o A071176 import Data.List (findIndex)
%o A071176 import Data.Maybe (fromJust)
%o A071176 a071176 n = fromJust $ findIndex (== 1) $
%o A071176             map (a010052 . read . (show n ++) . show) [0..]
%o A071176 -- _Reinhard Zumkeller_, Aug 09 2011
%o A071176 (PARI) a(n)={if(issquare(10*n), 0, my(m=n, b=1); while(1, m*=10; my(r=(sqrtint(m+b-1)+1)^2-m); b*=10; if(r<b, return(r))))} \\ _Andrew Howroyd_, Jan 13 2023
%o A071176 (Python)
%o A071176 from math import isqrt
%o A071176 from sympy.ntheory.primetest import is_square
%o A071176 def A071176(n):
%o A071176     m = 10*n
%o A071176     if is_square(m): return 0
%o A071176     a = 1
%o A071176     while (k:=(isqrt(a*(m+1)-1)+1)**2-m*a)>=10*a:
%o A071176         a *= 10
%o A071176     return k # _Chai Wah Wu_, Feb 15 2023
%Y A071176 Cf. A000196, A071177, A245631, A132356.
%K A071176 nonn,base,nice,look
%O A071176 1,1
%A A071176 _Reinhard Zumkeller_, May 15 2002