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

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

A076490 Number of common (distinct) digits of consecutive prime numbers.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Oct 21 2002

Keywords

Examples

			1 to 9 common digits for {11 and 13},{101,103},{1031,1033}, {10223,10243},{97213,97231},{126079,126097},{1206479,1206497}, {10186237,10186273},{100438279,100438297} respectively.
		

Crossrefs

Programs

  • Haskell
    import Data.List (intersect, nub); import Data.Function (on)
    a076490 n = a076490_list !! n
    a076490_list = map (length . nub) $
       zipWith (intersect `on` show) (tail a000040_list) a000040_list
    -- Reinhard Zumkeller, Sep 01 2013
    
  • Mathematica
    Table[Length[Intersection[IntegerDigits[Prime[w]], IntegerDigits[ Prime[ w+1]]]], {w, 1, 200}] (* corrected by Harvey P. Dale, May 14 2014 *)
    Length[Intersection@@IntegerDigits[#]]&/@Partition[Prime[Range[110]],2,1] (* Harvey P. Dale, May 14 2014 *)
  • PARI
    a(n) = my(p=prime(n)); #setintersect(Set(digits(p)), Set(digits(nextprime(p+1)))); \\ Michel Marcus, Mar 27 2023

A238845 Prefix overlap between binary expansions of n and n+1.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 22 2014

Keywords

Comments

The prefix overlap between two words is the length of their longest common prefix.

Examples

			8 = 1000 and 9 = 1001 have prefix overlap of 3, so a(8)=3.
		

Crossrefs

Programs

  • Haskell
    import Data.List (unfoldr); import Data.Tuple (swap)
    a238845 n = length $ takeWhile (== 0) $ zipWith (-) (bin n) (bin (n+1))
    where bin = reverse . unfoldr
    (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 2)
    -- Reinhard Zumkeller, Mar 22 2014
    
  • Maple
    # prefix overlap between n and n+1 in base b:
    po:=proc(n,b) local t1,t2,l1,l2,c,L,i;
    t1:=convert(n,base,b); l1:=nops(t1);
    t2:=convert(n+1,base,b); l2:=nops(t2);
    c:=0; L:=min(l1,l2);
    for i from 1 to L do
    if t1[l1+1-i] = t2[l2+1-i] then c:=c+1; else break; fi; od:
    c;
    end;
    [seq(po(n,2),n=0..120)];
  • Mathematica
    a[n_] := With[{v = IntegerExponent[n+1, 2]}, Floor[Log[2, n+1]] - v + Boole[n+1 == 2^v] - Boole[n == 0]]; Table[a[n], {n, 0, 90}] (* Jean-François Alcover, Feb 03 2018, after Charles R Greathouse IV *)
    pol[n_]:=Module[{c1=IntegerDigits[n,2],c2=IntegerDigits[n+1,2]},Total[ Split[ If[#[[1]]==#[[2]],1,0]&/@Thread[{c1,Take[c2,Length[c1]]}]][[1]]]];Array[pol,100,0] (* Harvey P. Dale, Jun 12 2020 *)
  • PARI
    a(n)=my(v=valuation(n+1,2)); logint(n+1,2) - v + (n+1==1<Charles R Greathouse IV, Dec 29 2017

Formula

For all n > 0, a(n-1) = A000523(n) - A007814(n) + A209229(n) - A063524(n) = floor(log_2(n)) - v_2(n) + [exists(k,n==2^k)] - [n==1]. (see link) - Luc Rousseau, Dec 29 2017

A076491 a(2*n), a(2*n+1) is the smallest consecutive prime pairs with at least n distinct common decimal digits.

Original entry on oeis.org

2, 3, 11, 13, 101, 103, 1031, 1033, 10223, 10243, 18379, 18397, 126079, 126097, 1206479, 1206497, 10258379, 10258397, 102346879, 102346897, 10127685439, 10127685493
Offset: 0

Views

Author

Labos Elemer, Oct 21 2002

Keywords

Comments

If the common digits were not required to be distinct, the resulting sequence would be 2, 3, 11, 13, 101, 103, 1013, 1019, 1913, 1931, 18379, 18397, 109279, 109297, 1000213, 1000231, ... - Giovanni Resta, Oct 29 2019

Crossrefs

Programs

  • Mathematica
    aa[n_] := Block[{p,q,cp,cq}, p = NextPrime[10^(n - 1)]; cp = IntegerDigits@ p; While[True, q = NextPrime[p]; cq = IntegerDigits[q]; If[ Length[ Intersection[cp, cq]] >= n, Break[]]; p=q; cp=cq]; {p, q}]; Flatten[aa /@ Range[0, 9]] (* Giovanni Resta, Oct 29 2019 *)

Extensions

Corrected and extended by Giovanni Resta, Oct 29 2019

A226637 Numbers m having with m+1 no common digit in decimal representations.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 99, 199, 299, 399, 499, 599, 699, 799, 999, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 99999, 199999, 299999, 399999
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 01 2013

Keywords

Crossrefs

Programs

  • Haskell
    a226637 n = a226637_list !! (n-1)
    a226637_list = filter ((== 0) . a076489) [0..]
    
  • PARI
    isok(k) = #setintersect(Set(digits(k)), Set(digits(k+1))) == 0; \\ Michel Marcus, Feb 07 2025

Formula

A076489(a(n)) = 0;
A000030(a(n)) <> 8 for n > 9.

A239092 Prefix overlap of dictionary consisting of decimal expansions of 0 through n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 100, 102, 104, 106, 108, 110
Offset: 1

Views

Author

N. J. A. Sloane, Mar 22 2014

Keywords

Comments

The prefix overlap between two words is the length of their longest common prefix.
The prefix overlap of a dictionary is the sum of the prefix overlaps between successive words.
Partial sums of A076489.
More than the usual number of terms are displayed in order to distinguish this from some closely related sequences.

Crossrefs

Different from A081600 and A028904.

A076492 Number of common decimal digits of n! and (n+1)!.

Original entry on oeis.org

0, 0, 0, 1, 2, 1, 2, 3, 5, 4, 4, 3, 4, 4, 3, 5, 8, 7, 7, 6, 5, 7, 9, 7, 8, 9, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 9, 9, 10, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
Offset: 1

Views

Author

Labos Elemer, Oct 21 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length[Intersection[IntegerDigits[(n+1)!], IntegerDigits[n!]]], {n, 1, 100}]
    Length[Intersection[#[[1]],#[[2]]]]&/@Partition[IntegerDigits[ Range[ 90]!],2,1] (* Harvey P. Dale, Jun 26 2021 *)

Extensions

More terms from Diana L. Mecum, Jun 17 2007

A076494 Number of common decimal digits of 2^n and 2^(1+n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 2, 2, 3, 2, 1, 2, 3, 2, 1, 2, 2, 3, 4, 3, 2, 1, 1, 1, 4, 4, 5, 6, 6, 4, 3, 3, 5, 6, 6, 5, 4, 4, 5, 5, 5, 6, 7, 6, 6, 7, 6, 6, 7, 7, 6, 5, 5, 6, 5, 7, 8, 7, 8, 8, 8, 8, 8, 8, 7, 9, 9, 9, 7, 6, 7, 7, 8, 8, 8, 7, 9, 9, 8, 9, 9, 9, 9, 8, 9, 10, 10, 9, 7, 8, 8, 9, 10, 10, 10, 10, 9, 9, 10, 9
Offset: 1

Views

Author

Labos Elemer, Oct 21 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length[Intersection[IntegerDigits[2^n], IntegerDigits[2^(n+1)]]], {n, 1, 100}]

A164832 Least nonnegative integer k such that the decimal representations of k and k+1 have n distinct digits in common.

Original entry on oeis.org

0, 10, 100, 1020, 10230, 102340, 1023450, 10234560, 102345670, 1023456780, 10234567889
Offset: 0

Views

Author

Rick L. Shepherd, Aug 27 2009

Keywords

Comments

Finding a(10), the final term, could be a simple but instructive puzzle.
a(1) through a(9) is a subsequence of A121030. a(0) through a(9) is a subsequence of A107411.

Examples

			a(10) = 10234567889 because 10234567889 and 10234567890 have all 10 decimal digits in common and this property does not hold for any smaller positive integer.
		

Crossrefs

Formula

For 1 <= n <= 10, a(n) is the least k such that A076489(k) = n. (This would be true for n = 0 also if A076489 considered nonnegative integers, having another initial 0 term and offset 0.).
Showing 1-9 of 9 results.