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.

A304290 Numbers k such that k-1 is a substring of k^2.

This page as a plain text file.
%I A304290 #30 Oct 22 2018 22:38:21
%S A304290 9,37,99,370,999,3367,9999,22186,99999,221860,333667,625001,625009,
%T A304290 859415,926968,999999,1507152,3125001,3701562,7012141,9375009,9999999,
%U A304290 20506249,28658098,33336667,46875009,78125001,79632152,86609391,98089448,99999999,306481073
%N A304290 Numbers k such that k-1 is a substring of k^2.
%C A304290 The repdigit sequence A002283, apart from the first term 0, is a subset.
%C A304290 In fact (999...9)^2 = (10^n-1)^2 = 10^n((10^n-1)-1)+1 = 10^n(999...9-1)+1 = 10^n(999...8)+1 = 999...8000...1.
%C A304290 The sequence A074992, apart from the first term 1, is a subsequence. - _Michel Marcus_, May 27 2018
%H A304290 Chai Wah Wu, <a href="/A304290/b304290.txt">Table of n, a(n) for n = 1..65</a> (n = 1..41 from Jon E. Schoenfield)
%e A304290 9^2 = 81 and 9-1 = 8 is a substring.
%e A304290 37^2 = 1369 and 37-1 = 36 is a substring.
%p A304290 P:=proc(q) local a,b,k,n; a:=2; b:=1;
%p A304290 for n from 1 to q do for k from 1 to ilog10(a^2)-ilog10(b)+1 do
%p A304290 if b=trunc(a^2/10^(k-1)) mod 10^(ilog10(b)+1) then print(a); fi; od;
%p A304290 b:=a; a:=a+1; od; print(); end: P(10^8);
%t A304290 Select[Range[10^6], SequenceCount[IntegerDigits[#^2], IntegerDigits[# - 1]] > 0 &] (* _Michael De Vlieger_, May 27 2018 *)
%o A304290 (Python)
%o A304290 A304290_list = [k for k in range(10**6) if str(k-1) in str(k**2)] # _Chai Wah Wu_, Oct 22 2018
%Y A304290 Cf. A002283, A074992, A282384.
%K A304290 nonn,base
%O A304290 1,1
%A A304290 _Paolo P. Lava_, May 24 2018
%E A304290 a(32) from _Jon E. Schoenfield_, Jun 01 2018