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

A029783 Exclusionary squares: numbers n such that no digit of n is present in n^2.

Original entry on oeis.org

2, 3, 4, 7, 8, 9, 17, 18, 22, 24, 29, 33, 34, 38, 39, 44, 47, 53, 54, 57, 58, 59, 62, 67, 72, 77, 79, 84, 88, 92, 94, 144, 157, 158, 173, 187, 188, 192, 194, 209, 212, 224, 237, 238, 244, 247, 253, 257, 259, 307, 313, 314, 333, 334, 338, 349, 353, 359
Offset: 1

Views

Author

Keywords

Comments

Complement of A189056; A076493(a(n)) = 0. - Reinhard Zumkeller, Apr 16 2011
A258682(a(n)) = a(n)^2. - Reinhard Zumkeller, Jun 07 2015
a(78) = 567 and a(112) = 854 are the only two numbers k such that the equation k^2 = m uses only once each of the digits 1 to 9 (reference David Wells). Exactly: 567^2 = 321489, and, 854^2 = 729316 (see A059930). - Bernard Schott, Jan 28 2021

Examples

			From _M. F. Hasler_, Oct 16 2018: (Start)
It is easy to construct infinite subsequences of the form S(a,b)(n) = a*R(n) + b, where R(n) = (10^n-1)/9 is the repunit of length n. Among these are:
S(3,0) = (3, 33, 333, ...), S(3,1) = (4, 34, 334, 3334, ...), S(3,5) = (8, 38, 338, ...), also b = 26, 44, 434, ... (with a = 3); S(6,1) = (7, 67, 667, ...), S(6,6) = (72, 672, 6672, ...) (excluding n=1), S(6,7) = (673, 6673, ...) (excluding also n=2 here), S(6,-7) = (59, 659, 6659, ...), and others. (End)
		

References

  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 60.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers, Revised Edition, 1997, page 144, entry 567.

Crossrefs

Cf. A059930 (n and n^2 use different digits), A112736 (numbers whose squares are exclusionary).

Programs

  • Haskell
    a029783 n = a029783_list !! (n-1)
    a029783_list = filter (\x -> a258682 x == x ^ 2) [1..]
    -- Reinhard Zumkeller, Jun 07 2015, Apr 16 2011
    
  • Mathematica
    Select[Range[1000], Intersection[IntegerDigits[ # ], IntegerDigits[ #^2]] == {} &] (* Tanya Khovanova, Dec 25 2006 *)
  • PARI
    is_A029783(n)=!#setintersect(Set(digits(n)),Set(digits(n^2))) \\ M. F. Hasler, Oct 16 2018
    
  • Python
    # see linked program
    
  • Python
    from itertools import count, islice
    def A029783_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:not set(str(n))&set(str(n**2)),count(max(startvalue,0)))
    A029783_list = list(islice(A029783_gen(),30)) # Chai Wah Wu, Feb 12 2023

Extensions

Definition slightly reworded at the suggestion of Franklin T. Adams-Watters by M. F. Hasler, Oct 16 2018

A076493 Number of common (distinct) decimal digits of n and n^2.

Original entry on oeis.org

1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 2, 1, 2, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 2, 1, 1, 0, 0, 1, 1, 0, 0, 0, 2, 1, 0, 2, 2, 1, 1, 0, 1, 1, 1, 1, 0, 1, 2, 1, 2, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 3, 2, 1, 1, 1
Offset: 0

Views

Author

Labos Elemer, Oct 21 2002

Keywords

Comments

a(A029783(n)) = 0, a(A189056(n)) > 0; 0 <= a(n) <= 10, see example for first occurrences. [Reinhard Zumkeller, Apr 16 2011]

Examples

			a(2) = #{} = 0: 2^2 = 4;
a(0) = #{0} = 1: 0^2 = 0;
a(10) = #{0,1} = 2: 10^2 = 100;
a(105) = #{0,1,5} = 3: 105^2 = 11025;
a(1025) = #{0,1,2,5} = 4: 1025^2 = 1050625;
a(10245) = #{0,1,2,4,5} = 5: 10245^2 = 104960025;
a(102384) = #{0,1,2,3,4,8} = 6: 102384^2 = 10482483456;
a(1023456789) = #{0 .. 9} = 10: 1023456789^2 = 1047463798950190521.
		

Crossrefs

Programs

  • Haskell
    import Data.List (intersect, nub)
    import Data.Function (on)
    a076493 n = length $ (intersect `on` nub . show) n (n^2)
    -- Reinhard Zumkeller, Apr 16 2011
  • Mathematica
    Table[Length[Intersection[IntegerDigits[n], IntegerDigits[n^2]]], {n, 1, 100}]

Extensions

Initial 1 added and offset adjusted by Reinhard Zumkeller, Apr 16 2011

A253600 Smallest exponent k>1 such that n and n^k have some digits in common.

Original entry on oeis.org

2, 2, 5, 5, 3, 2, 2, 5, 5, 3, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 4, 2, 3, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 2, 2, 2, 3, 3, 2, 2, 2, 2, 3, 2, 2, 4, 2, 2, 2, 2, 2, 5, 3, 2, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 2, 2, 2, 5, 2, 3, 2, 2, 2, 2, 3, 2, 2
Offset: 0

Views

Author

Michel Marcus, Jan 05 2015

Keywords

Comments

For all n, n^5-n is divisible by 10, and so n^5 == n (mod 10). Thus a(n) <= 5 for all n. - Tom Edgar, Jan 06 2015

Examples

			For n=2, 2^k has no digit in common with 2 until k reaches 5 to give 32, hence a(2)=5.
		

Crossrefs

Cf. sequences where a(n)=k: A103173 (k=5), A189056 (k=2), A253601 (k=3), A253602 (k=4).
Cf. A373203.

Programs

  • Maple
    f:= proc(n) local L,k;
     L:= convert(convert(n,base,10),set);
     for k from 2 do
       if convert(convert(n^k,base,10),set) intersect L <> {} then
         return k
       fi
     od
    end proc:
    map(f, [$0..100]); # Robert Israel, Mar 17 2020
  • Mathematica
    seq={};Do[k=1;Until[ContainsAny[IntegerDigits[n],IntegerDigits[n^k]],k++];AppendTo[seq,k] ,{n,0,86}];seq (* James C. McMahon, Jun 04 2024 *)
  • PARI
    a(n) = {sd = Set(vecsort(digits(n))); k=2; while (#setintersect(sd, Set(vecsort(digits(n^k)))) == 0, k++); k;}

A258682 Remove from n^2 all digits of n from left to right, in decimal representation.

Original entry on oeis.org

0, 0, 4, 9, 16, 2, 3, 49, 64, 81, 0, 2, 44, 69, 96, 22, 25, 289, 324, 36, 40, 44, 484, 59, 576, 6, 76, 9, 74, 841, 90, 96, 104, 1089, 1156, 122, 129, 169, 1444, 1521, 160, 681, 176, 189, 1936, 202, 211, 2209, 230, 201, 20, 260, 704, 2809, 2916, 302, 313
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 07 2015

Keywords

Comments

a(A029783(n)) = A029783(n)^2; a(A189056(n)) < A189056(n)^2;
a(A178501(n)) = 0.

Examples

			.    n   n^2 |  a(n)
. -----------+------
.   20   400 |    40
.   21   441 |    44
.   22   484 |   484
.   23   529 |    59
.   24   576 |   576
.   25   625 |     6
.   26   676 |    76  not 67, as digits of n are to be removed
.   27   729 |     9                                  from left to right
.   28   784 |    74
.   29   841 |   841
.   30   900 |    90  .
		

Crossrefs

Programs

  • Haskell
    import Data.List (delete)
    a258682 n = read ('0' : minus (show (n ^ 2)) (show n)) :: Int  where
       minus [] _  = []
       minus us [] = us
       minus (u:us) vs | elem u vs = minus us $ delete u vs
                       | otherwise = u : minus us vs
  • Mathematica
    a[n_]:=Module[{idn=IntegerDigits[n],idnn=IntegerDigits[n^2],idn1},
    idn1=DeleteCases[idn,m_/;MemberQ[Complement[idn,idnn],m]];
    Do[If[First[Position[idnn,idn1[[i]]]]!= {},idnn=Delete[idnn,First[Position[idnn,idn1[[i]]]]]],
    {i,1,Length[idn1]}];FromDigits[idnn]]//Quiet;
    a/@Range[0,56] (* Ivan N. Ianakiev, Jun 11 2015 *)

A253601 Numbers such that the smallest exponent for n and n^k to have common digits is 3.

Original entry on oeis.org

4, 9, 17, 18, 24, 29, 33, 34, 38, 39, 44, 54, 57, 58, 59, 62, 67, 72, 79, 84, 88, 94, 144, 158, 173, 194, 209, 212, 224, 237, 238, 244, 247, 253, 257, 259, 307, 313, 314, 333, 334, 338, 349, 353, 359, 377, 388, 404, 409, 424, 437, 444, 447, 449, 454, 459, 467
Offset: 1

Views

Author

Michel Marcus, Jan 05 2015

Keywords

Examples

			4^2=16 has no digits in common with 4, but 4^3=64 has some, so 4 is in the sequence.
		

Crossrefs

Programs

  • PARI
    a253600(n) = {sd = Set(vecsort(digits(n))); k=2; while (#setintersect(sd, Set(vecsort(digits(n^k)))) == 0, k++); k;}
    isok(n) = a253600(n) == 3;
    
  • PARI
    is(n) = my(d(k)=Set(digits(n^k))); !#setintersect(d(1), d(2)) && #setintersect(d(1), d(3)) \\ Iain Fox, Aug 07 2018

A253602 Numbers n such that the smallest exponent k for n and n^k to have common digits is 4.

Original entry on oeis.org

22, 47, 92, 157, 187, 188, 192, 552, 558, 577, 707, 772, 922, 2522, 8338, 17177, 66888, 575757, 929522, 1717177, 8888588
Offset: 1

Views

Author

Michel Marcus, Jan 05 2015

Keywords

Examples

			22^2=484 and 22^3=10648 have no digits in common with 22, but 22^4=234256 has some, so 22 is in the sequence.
		

Crossrefs

Programs

  • PARI
    a253600(n) = {sd = Set(vecsort(digits(n))); k=2; while (#setintersect(sd, Set(vecsort(digits(n^k)))) == 0, k++); k;}
    isok(n) = a253600(n) == 4;

A326418 Nonnegative numbers k such that, in decimal representation, the subsequence of digits of k^2 occupying an odd position is equal to the digits of k.

Original entry on oeis.org

0, 1, 5, 6, 10, 11, 50, 60, 76, 100, 105, 110, 500, 501, 505, 506, 600, 605, 756, 760, 826, 1000, 1001, 1050, 1100, 5000, 5010, 5050, 5060, 5941, 6000, 6050, 7560, 7600, 8260, 10000, 10005, 10010, 10500, 10505, 11000, 12731
Offset: 1

Views

Author

Keywords

Comments

If k is in the sequence then so is 10*k. - David A. Corneth, Sep 29 2019
No term starts with the digit 2. - Chai Wah Wu, Apr 04 2023

Examples

			5^2 = 25, whose first digit is 5, hence 5 is a term of the sequence.
11^2 = 121, whose first and third digit are (1, 1), hence 11 is a term of the sequence.
756^2 = 571536, whose digits in odd positions - starting from the least significant one - are (7, 5, 6), hence 756 is a term of the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 13000], Reverse@ #[[-Range[1, Length@ #, 2]]] &@ IntegerDigits[#^2] === IntegerDigits[#] &] (* Michael De Vlieger, Oct 06 2019 *)
  • PARI
    isok(n) = my(d=Vecrev(digits(n^2))); fromdigits(Vecrev(vector((#d+1)\2, k, d[2*k-1]))) == n; \\ Michel Marcus, Oct 01 2019
    
  • Python
    def ok(n): s = str(n*n); return n == int("".join(s[1-len(s)%2::2]))
    print(list(filter(ok, range(13000)))) # Michael S. Branicky, Sep 10 2021
Showing 1-7 of 7 results.