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-2 of 2 results.

A238712 Numbers in which squares may end (in base 10).

Original entry on oeis.org

0, 1, 4, 5, 6, 9, 16, 21, 24, 25, 29, 36, 41, 44, 49, 56, 61, 64, 69, 76, 81, 84, 89, 96, 100, 104, 116, 121, 124, 129, 136, 144, 156, 161, 164, 169, 176, 184, 196, 201, 204, 209, 216, 224, 225, 236, 241, 244, 249, 256, 264, 276, 281, 284, 289, 296, 304
Offset: 1

Views

Author

M. F. Hasler, Mar 03 2014

Keywords

Comments

The union of "squares mod 10" (= the first 6 terms) and "squares mod 100" (A010461) and "squares mod 1000" (A122986) etc.
The number of terms < 10^k beginning with k=0: 1, 6, 24, 165, 1101, 9306, 79620, 753462, 7198791, 70919559, ... - Robert G. Wilson v, Sep 04 2014

Examples

			6 is in the sequence because 4^2 = 16 ends in the digit 6.
7 is not in the sequence because no square can end with the digit 7.
		

Crossrefs

Cf. A161355, A246422, A246448 (Complement).

Programs

  • Mathematica
    mx = 3; t = Union@ Table[ Mod[n^2, 10^mx], {n, 10^mx/2}]; t = Union@ Flatten@ Table[ Mod[t, 10^m], {m, mx}] (* Robert G. Wilson v, Sep 04 2014 *)
  • PARI
    a=[];for(m=1,3,a=setunion(a,Set(vector(10^m,n,n^2)%10^m)));a

Formula

If n is present so is n^2. - Robert G. Wilson v, Sep 04 2014

A246449 Numbers k such that no cube can end in k (in the sense of the respective decimal expansions).

Original entry on oeis.org

10, 14, 15, 18, 20, 22, 26, 30, 34, 35, 38, 40, 42, 45, 46, 50, 54, 55, 58, 60, 62, 65, 66, 70, 74, 78, 80, 82, 85, 86, 90, 94, 95, 98, 100, 102, 105, 106, 108, 110, 114, 115, 116, 118, 120, 122, 124, 126, 130, 132, 134, 135, 138, 140, 142, 145, 146, 148, 150, 154, 155
Offset: 1

Views

Author

Derek Orr, Aug 26 2014

Keywords

Comments

Complement of A246422.
The terms with n digits are the complement in [10^(n-1) .. 10^n-1] of the set of residues of k^3 mod 10^n for 10^((n-1)/3) < k < 10^n. - M. F. Hasler, Jan 26 2020

Crossrefs

Cf. A246422.

Programs

  • Maple
    seq(op(sort(convert({$10^(d-1)..10^d-1} minus map(t -> t^3 mod 10^d, {$0..10^d-1}),list))),d=1..3); # Robert Israel, Jan 26 2020
  • PARI
    v=vector(1000); for(k=1,10^4, my(q=k^3,w=digits(q));for(j=0,2, v[1+fromdigits(w[#w-j..#w])]++)); for(k=1,160, if(v[k]==0,print1(k-1,", "))) \\ Hugo Pfoertner, Jan 26 2020
    
  • PARI
    A246449_row(n)=setminus([10^(n-1)..10^n-1],Set([k^3|k<-[sqrtnint(10^(n-1),3)+1..10^n-1]]%10^n)) \\ Yields the n-digit terms. - M. F. Hasler, Jan 26 2020
    
  • Python
    from sympy import nthroot_mod
    from itertools import count, islice
    def A246449_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n: nthroot_mod(n,3,10**(len(str(n)))) is None, count(max(startvalue,0)))
    A246449_list = list(islice(A246449_gen(),20)) # Chai Wah Wu, Feb 16 2023

Extensions

Corrected by Robert Israel, Jan 26 2020
Name edited and incorrect PARI program deleted by M. F. Hasler, Jan 26 2020
Showing 1-2 of 2 results.