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.

A323612 Numbers k such that k^2 starts with at least the same number >= 2 of equal digits as does k itself.

This page as a plain text file.
%I A323612 #36 Jun 03 2025 02:28:37
%S A323612 88,332,334,335,336,337,338,339,664,665,667,668,669,880,881,882,883,
%T A323612 995,996,997,998,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,
%U A323612 3327,3328,3329,3332,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347
%N A323612 Numbers k such that k^2 starts with at least the same number >= 2 of equal digits as does k itself.
%H A323612 Reiner Moewald, <a href="/A323612/b323612.txt">Table of n, a(n) for n = 1..24527</a>
%e A323612 332^2 = 110224, i.e., both the integer and its square start with two equal digits.
%e A323612 Also 334^2 = 111556, so 334 is a term.
%o A323612 (Python)
%o A323612 def zahl(z):
%o A323612    a = str(z)
%o A323612    r = 0
%o A323612    while r < len(a) and a[0] == a[r]:
%o A323612       r = r + 1
%o A323612    b = str(z*z)
%o A323612    s = 0
%o A323612    while r < len(b) and b[0] == b[s]:
%o A323612       s = s + 1
%o A323612    if r >= 2:
%o A323612       return(s-r)
%o A323612    else:
%o A323612       return(-1)
%o A323612 anz = 0
%o A323612 for i in range(1000000):
%o A323612    if zahl(i) >= 0:
%o A323612       anz = anz +1
%o A323612       print(anz, i)
%o A323612 (PARI) nbi(d) = my(nb=1); for(k=2, #d, if (d[k] == d[1], nb++, break)); nb;
%o A323612 isok(n) = my(nb = nbi(digits(n))); (nb > 1) && (nbi(digits(n^2)) >= nb); \\ _Michel Marcus_, Apr 24 2019
%K A323612 nonn,base
%O A323612 1,1
%A A323612 _Reiner Moewald_, Jan 20 2019