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.

Showing 1-4 of 4 results.

A008851 Congruent to 0 or 1 mod 5.

Original entry on oeis.org

0, 1, 5, 6, 10, 11, 15, 16, 20, 21, 25, 26, 30, 31, 35, 36, 40, 41, 45, 46, 50, 51, 55, 56, 60, 61, 65, 66, 70, 71, 75, 76, 80, 81, 85, 86, 90, 91, 95, 96, 100, 101, 105, 106, 110, 111, 115, 116, 120, 121, 125, 126, 130, 131, 135, 136, 140, 141, 145, 146, 150, 151
Offset: 1

Views

Author

Keywords

Comments

Numbers k that have the same last digit as k^2.

References

  • L. E. Dickson, History of the Theory of Numbers, I, p. 459.

Crossrefs

Programs

  • Haskell
    a008851 n = a008851_list !! (n-1)
    a008851_list = [10*n + m | n <- [0..], m <- [0,1,5,6]]
    -- Reinhard Zumkeller, Jul 27 2011
    
  • Magma
    [n: n in [0..200] | n mod 5 in {0, 1}]; // Vincenzo Librandi, Nov 17 2014
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=a[n-2]+5 od: seq(a[n], n=0..61); # Zerinvary Lajos, Mar 16 2008
  • Mathematica
    Select[Range[0, 151], MemberQ[{0, 1}, Mod[#, 5]] &] (* T. D. Noe, Mar 31 2013 *)
  • PARI
    a(n) = 5*(n\2)+bitand(n,1); /* Joerg Arndt, Mar 31 2013 */
    
  • PARI
    a(n) = floor((5/3)*floor(3*(n-1)/2)); /* Joerg Arndt, Mar 31 2013 */
    

Formula

a(n) = 5*n - a(n-1) - 9, n >= 2. - Vincenzo Librandi, Nov 18 2010 [Corrected for offset by David Lovler, Oct 10 2022]
G.f.: x^2*(1+4*x) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Oct 07 2011
a(n+1) = Sum_{k>=0} A030308(n,k)*A146523(k). - Philippe Deléham, Oct 17 2011
a(n) = floor((5/3)*floor(3*(n-1)/2)). - Clark Kimberling, Jul 04 2012
a(n) = (10*n - 13 - 3*(-1)^n)/4. - Robert Israel, Nov 17 2014 [Corrected by David Lovler, Sep 21 2022]
E.g.f.: 4 + ((10*x - 13)*exp(x) - 3*exp(-x))/4. - David Lovler, Sep 11 2022
Sum_{n>=2} (-1)^n/a(n) = sqrt(1+2/sqrt(5))*Pi/10 + log(phi)/(2*sqrt(5)) + log(5)/4, where phi is the golden ratio (A001622). - Amiram Eldar, Oct 12 2022

Extensions

Offset corrected by Reinhard Zumkeller, Jul 27 2011

A018834 Numbers k such that the decimal expansion of k^2 contains k as a substring.

Original entry on oeis.org

0, 1, 5, 6, 10, 25, 50, 60, 76, 100, 250, 376, 500, 600, 625, 760, 1000, 2500, 3760, 3792, 5000, 6000, 6250, 7600, 9376, 10000, 14651, 25000, 37600, 50000, 60000, 62500, 76000, 90625, 93760, 100000, 109376, 250000, 376000, 495475, 500000, 505025
Offset: 1

Views

Author

Keywords

Examples

			25^2 = 625 which contains 25.
3792^2 = 14_3792_64, 14651^2 = 2_14651_801.
		

Crossrefs

Cf. A000290. Supersequence of A029943.
Cf. A018826 (base 2), A018827 (base 3), A018828 (base 4), A018829 (base 5), A018830 (base 6), A018831 (base 7), A018832 (base 8), A018833 (base 9).
Cf. A029942 (cubes), A075904 (4th powers), A075905 (5th powers).

Programs

  • Haskell
    import Data.List (isInfixOf)
    a018834 n = a018834_list !! (n-1)
    a018834_list = filter (\x -> show x `isInfixOf` show (x^2)) [0..]
    -- Reinhard Zumkeller, Jul 27 2011
    
  • Mathematica
    Select[Range[510000], MemberQ[FromDigits /@ Partition[IntegerDigits[#^2], IntegerLength[#], 1], #] &] (* Jayanta Basu, Jun 29 2013 *)
    Select[Range[0,510000],StringPosition[ToString[#^2],ToString[#]]!={}&] (* Ivan N. Ianakiev, Oct 02 2016 *)
  • Python
    from itertools import count, islice
    def A018834_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:str(n) in str(n**2), count(max(startvalue,0)))
    A018834_list = list(islice(A018834_gen(),20)) # Chai Wah Wu, Apr 04 2023

A046851 Numbers n such that n^2 can be obtained from n by inserting internal (but not necessarily contiguous) digits.

Original entry on oeis.org

0, 1, 10, 11, 95, 96, 100, 101, 105, 110, 125, 950, 960, 976, 995, 996, 1000, 1001, 1005, 1006, 1010, 1011, 1021, 1025, 1026, 1036, 1046, 1050, 1100, 1101, 1105, 1201, 1205, 1250, 1276, 1305, 1316, 1376, 1405, 9500, 9505, 9511, 9525, 9600, 9605, 9625
Offset: 1

Views

Author

Keywords

Comments

Contains A038444. In particular, the sequence is infinite. - Robert Israel, Oct 20 2016
If n is any positive term, then b_n(k) := n*10^k (k >= 0) is an infinite subsequence. - Rick L. Shepherd, Nov 01 2016
From Robert Israel's comment it follows that the subsequence of terms with no trailing zeros is also infinite (contains A000533). - Rick L. Shepherd, Nov 01 2016

Examples

			110^2 = 12100 (insert "2" and "0" into "1_1_0").
		

Crossrefs

Cf. A045953, A008851, A018834, A038444, A086457 (subsequence).

Programs

  • Haskell
    import Data.List (isInfixOf)
    a046851 n = a046851_list !! (n-1)
    a046851_list = filter chi a008851_list where
       chi n = (x == y && xs `isSub` ys) where
          x:xs = show $ div n 10
          y:ys = show $ div (n^2) 10
       isSub [] ys       = True
       isSub _  []       = False
       isSub us'@(u:us) (v:vs)
             | u == v    = isSub us vs
             | otherwise = isSub us' vs
    -- Reinhard Zumkeller, Jul 27 2011
  • Maple
    IsSublist:= proc(a, b)
      local i,bp,j;
      bp:= b;
      for i from 1 to nops(a) do
        j:= ListTools:-Search(a[i],bp);
        if j = 0 then return false fi;
        bp:= bp[j+1..-1];
      od;
      true
    end proc:
    filter:= proc(n) local A,B;
      A:= convert(n,base,10);
      B:= convert(n^2,base,10);
      if not(A[1] = B[1] and A[-1] = B[-1]) then return false fi;
      if nops(A) <= 2 then return true fi;
      IsSublist(A[2..-2],B[2..-2])
    end proc:
    select(filter, [$0..10^4]); # Robert Israel, Oct 20 2016
  • Mathematica
    id[n_]:=IntegerDigits[n];
    insQ[n_]:=First[id[n]]==First[id[n^2]]&&Last[id[n]]==Last[id[n^2]];
    sort[n_]:=Flatten/@Table[Position[id[n^2],id[n][[i]]],{i,1,Length[id[n]]}];
    takeQ[n_]:=Module[{lst={First[sort[n][[1]]]}},
       Do[
        Do[
         If[Last[lst]Ivan N. Ianakiev, Oct 19 2016 *)

A086457 Both n and n^2 have the same initial digit and also n and n^2 have the same final digit when expressed in base 10.

Original entry on oeis.org

0, 1, 10, 11, 95, 96, 100, 101, 105, 106, 110, 111, 115, 116, 120, 121, 125, 126, 130, 131, 135, 136, 140, 141, 895, 896, 950, 951, 955, 956, 960, 961, 965, 966, 970, 971, 975, 976, 980, 981, 985, 986, 990, 991, 995, 996, 1000, 1001, 1005, 1006, 1010, 1011
Offset: 1

Views

Author

Jeremy Gardiner, Jul 20 2003

Keywords

Comments

All terms of A045953 appear in this sequence.
Subsequence of A008851; A045953 and A046851 are subsequences. [Reinhard Zumkeller, Jul 27 2011]
Intersection of A008851 and A089951. - Michel Marcus, Mar 19 2015

Examples

			a(12) = 115 appears in the sequence because 115*115 = 13225.
		

Crossrefs

Programs

  • BASIC
    left$(str$(n), 1) = left$(str$(n^2), 1) AND right$(str$(n), 1) = right$(str$(n^2), 1)
    
  • Haskell
    a086457 n = a086457_list !! (n-1)
    a086457_list = filter (\x -> a000030 x == a000030 (x^2) &&
                                 a010879 x == a010879 (x^2)) [0..]
    -- Reinhard Zumkeller, Jul 27 2011
  • Mathematica
    ldQ[n_]:=Module[{idn=IntegerDigits[n],idn2=IntegerDigits[n^2]}, First[ idn] == First[idn2]&&Last[idn]==Last[idn2]]; Select[Range[ 0,1100], ldQ]  (* Harvey P. Dale, Feb 06 2011 *)

Formula

A000030(a(n)) = A000030(a(n)^2) and A010879(a(n)) = A010879(a(n)^2).

Extensions

Offset corrected by Reinhard Zumkeller, Jul 27 2011
Showing 1-4 of 4 results.