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.

Previous Showing 31-40 of 119 results. Next

A372034 For a positive number k, let L(k) denote the list consisting of k followed by the prime factors of k, with repetition, in nondecreasing order; sequence gives composite k such that the digits of L(k) are in nonincreasing order.

Original entry on oeis.org

4, 8, 9, 22, 32, 33, 44, 55, 64, 77, 88, 93, 99, 422, 633, 775, 844, 933, 993, 4222, 4442, 6333, 6655, 6663, 7533, 7744, 7775, 8444, 8884, 9663, 9993, 44222, 66333, 88444, 99633, 99933, 99993, 933333, 966333, 996663, 999993, 4442222, 6663333, 7777775, 8884444, 9663333, 9666633, 9666663
Offset: 1

Views

Author

Scott R. Shannon, Apr 16 2024

Keywords

Comments

Is it true that no terms end with 1? A separate search on those shows none with < 70 digits. Michael S. Branicky, Apr 23 2024
Testing all products of repunit primes (A004022, A004023), there are no terms ending in 1 less than 10^3000. - Michael S. Branicky, Apr 24 2024

Examples

			The initial terms and their factorizations are:
4 = [2, 2]
8 = [2, 2, 2]
9 = [3, 3]
22 = [2, 11]
32 = [2, 2, 2, 2, 2]
33 = [3, 11]
44 = [2, 2, 11]
55 = [5, 11]
64 = [2, 2, 2, 2, 2, 2]
77 = [7, 11]
88 = [2, 2, 2, 11]
93 = [3, 31]
99 = [3, 3, 11]
422 = [2, 211]
633 = [3, 211]
775 = [5, 5, 31]
844 = [2, 2, 211]
933 = [3, 311]
993 = [3, 331]
4222 = [2, 2111]
4442 = [2, 2221]
6333 = [3, 2111]
6655 = [5, 11, 11, 11]
6663 = [3, 2221]
7533 = [3, 3, 3, 3, 3, 31]
7744 = [2, 2, 2, 2, 2, 2, 11, 11]
...
		

Crossrefs

Programs

  • Python
    from sympy import factorint, isprime
    def ni(s): return sorted(s, reverse=True) == list(s)
    def ok(n):
        if n < 4 or isprime(n): return False
        s, f = str(n), "".join(str(p)*e for p, e in factorint(n).items())
        return ni(s+f)
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Apr 23 2024
    
  • Python
    # faster for initial segment of sequence
    from sympy import factorint, isprime
    from itertools import islice, combinations_with_replacement as mc
    def ni(s): return s == "".join(sorted(s, reverse=True))
    def bgen(d):
        yield from ("".join(m) for m in mc("987654321", d))
    def agen(): # generator of terms
        for d in range(1, 70):
            out = set()
            for s in bgen(d):
                t = int(s)
                if t < 4 or isprime(t): continue
                if ni(s+"".join(str(p)*e for p, e in factorint(t).items())):
                    out.add(t)
            yield from sorted(out)
    print(list(islice(agen(), 50))) # Michael S. Branicky, Apr 23 2024

A034093 Number of near-repunit primes that can be formed from (10^k - 1)/9 by changing just one digit from 1 to 0.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			a(12) = 5 because from (10^12 - 1)/9 = 111111111111, by changing just one digit from 1 to 0, out of the eleven candidates, 111111111101, 111111110111, 111111011111, 111011111111 and 101111111111 are primes.
		

References

  • C. K. Caldwell and H. Dubner, The near repunits primes, J. Rec. Math., Vol. 27(1), 1995, pp. 35-41.

Crossrefs

Programs

  • Mathematica
    a = {}; Do[ p = IntegerDigits[ (10^n - 1)/9 ]; c = 0; Do[ If[ q = FromDigits[ ReplacePart[p, 0, i]]; PrimeQ[q], c++ ], {i, 2, n} ]; a = Append[a, c], {n, 1, 100} ]; a (* Robert G. Wilson v, Nov 19 2001 *)
  • PARI
    a(n)=sum(i=1,n-2,ispseudoprime(10^n\9-10^i)) \\ Charles R Greathouse IV, May 01 2012
    
  • Python
    from sympy import isprime
    def a(n):
        Rn = (10**n-1)//9
        return sum(1 for i in range(n-1) if isprime(Rn-10**i))
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Nov 04 2023

Extensions

More terms from Robert G. Wilson v, Nov 19 2001
Edited by N. J. A. Sloane, Oct 02 2008 at the suggestion of R. J. Mathar

A046376 Palindromes with exactly 2 palindromic prime factors (counted with multiplicity), and no other prime factors.

Original entry on oeis.org

4, 6, 9, 22, 33, 55, 77, 121, 202, 262, 303, 393, 505, 626, 707, 939, 1111, 1441, 1661, 1991, 3443, 3883, 7997, 10201, 13231, 15251, 18281, 19291, 20602, 22622, 22822, 24842, 26662, 28682, 30903, 31613, 33933, 35653, 37673, 38683, 39993, 60206, 60406, 60806
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Comments

Equivalently, semiprime palindromes where both prime factors are palindromes. - Franklin T. Adams-Watters, Apr 11 2011
The sequence "trivially" includes products of palindromic primes p*q where
a) p = 2 or 3 and q has only digits < 4, as q = 11, 101, 131, 10301, 30103, ...
b) p <= 11 and q has only digits 0 and 1, as q = 101 and repunit primes A004022
c) p = 11 and q has only digits spaced out by zeros, as q = 101, 10301, 10501, 10601, 30103, 30203, 30403, 30703, 30803, ... - M. F. Hasler, Jan 04 2022

Examples

			The palindrome 35653 is a term since it has 2 factors, 101 and 353, both palindromic.
		

Crossrefs

Cf. A001358 (semiprimes), A002113 (palindromes), A002385 (palindromic primes).
Subsequence of A188650.

Programs

  • Mathematica
    Take[Select[Times@@@Tuples[Select[Prime[Range[5000]],PalindromeQ],2], PalindromeQ]// Union,50] (* Harvey P. Dale, Aug 25 2019 *)
  • PARI
    {first(N=50, p=1) = vector(N, i, until( bigomega( p=nxt_A002113(p))==2 && vecmin( apply( is_A002113, factor(p)[,1])),); p)} \\ M. F. Hasler, Jan 04 2022
    
  • Python
    from sympy import factorint
    from itertools import product
    def ispal(n): s = str(n); return s == s[::-1]
    def pals(d, base=10): # all d-digit palindromes
        digits = "".join(str(i) for i in range(base))
        for p in product(digits, repeat=d//2):
            if d > 1 and p[0] == "0": continue
            left = "".join(p); right = left[::-1]
            for mid in [[""], digits][d%2]: yield int(left + mid + right)
    def ok(pal):
        f = factorint(pal)
        return sum(f.values()) == 2 and all(ispal(p) for p in f)
    print(list(filter(ok, (p for d in range(1, 6) for p in pals(d) if ok(p))))) # Michael S. Branicky, Aug 14 2022

Formula

Intersection of A002113 and A046368; A188649(a(n)) = a(n). - Reinhard Zumkeller, Apr 11 2011

Extensions

Definition clarified by Franklin T. Adams-Watters, Apr 11 2011
More terms from Lars Blomberg, Nov 06 2015

A116692 Primes with only one distinct decimal digit. Also called repunit primes or repdigit primes.

Original entry on oeis.org

2, 3, 5, 7, 11, 1111111111111111111, 11111111111111111111111
Offset: 1

Views

Author

Rick L. Shepherd, Feb 22 2006

Keywords

Comments

Primes in A010785 (repdigit numbers). Union of single-digit primes and A004022 (repunit primes). A004023 shows that the next term has 317 1's. The Mersenne primes (A000668) are the binary analog (i.e., bits are all 1's).

References

  • Clifford A. Pickover, A Passion for Mathematics (2005) at 60, 297.

Crossrefs

A004022 is a subsequence.
A subsequence of A055387, but not of A225053.

Extensions

Reference provided by Harvey P. Dale, Apr 19 2014
Definition expanded by N. J. A. Sloane, Jan 22 2023

A187614 Primes p such that the decimal representation of 1/p does not contain every digit 0-9.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 31, 37, 41, 43, 67, 73, 79, 101, 137, 239, 271, 353, 449, 757, 859, 1933, 4649, 8779, 9091, 9901, 21401, 21649, 25601, 27961, 52579, 62003, 123551, 333667, 513239, 538987, 909091, 1676321, 2071723, 2906161, 5882353, 10838689, 35121409, 52986961, 99990001, 265371653, 1056689261, 1058313049, 1360682471
Offset: 1

Views

Author

Michel Lagneau, Mar 12 2011

Keywords

Comments

Every repunit prime (A004022) is here. There are 113 terms of A046107, having periods of up to 256, that are here. The only known unique-period prime (A007615) not here is the one having period 92092. Is this sequence finite? - T. D. Noe, Mar 13 2011

Examples

			4649 is in the sequence because 1/4649 = 0.00021510002151000215.... contain
  only the digits 0, 1, 2 and 5.
		

Crossrefs

Cf. A187372.
Cf. A352023 (does not contain digit 9)

Programs

  • Mathematica
    Join[{2, 3, 5}, Select[Prime[Range[4, 10000]], Length[Union[RealDigits[1/#][[1, 1]]]] < 10 &]]
  • Python
    from sympy import n_order, nextprime
    from itertools import islice
    def A187614_gen(): # generator of terms
        yield from (2,3,5)
        p = 7
        while True:
            if len(set('0'+str(10**(n_order(10, p))//p))) < 10:
                yield p
            p = nextprime(p)
    A187614_list = list(islice(A187614_gen(),20)) # Chai Wah Wu, Mar 03 2022

Extensions

Extended by T. D. Noe, Mar 12 2011

A262988 Number of distinct primes, including n if prime, obtained by cyclically shifting the digits of n.

Original entry on oeis.org

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

Views

Author

Felix Fröhlich, Oct 06 2015

Keywords

Comments

First differs from A039999 at n = 103.
Differs from A061264 iff n is a term of A004022.
a(n) = A055642(n) iff n is a term of A068652, except when n is also in A004022.

Examples

			a(1013) = 2, because of the four cyclic permutations of the digits of 1013 (1013, 131, 1310, 3101) two, namely 1013 and 131, are prime and those two primes are distinct.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{len = IntegerLength@ n, s = {n}}, Do[AppendTo[s, FromDigits@ RotateRight@ IntegerDigits@ s[[k - 1]]], {k, 2, len}]; DeleteDuplicates@ Select[s, PrimeQ]]; Array[ Length@ f@ # &, {87}] (* Michael De Vlieger, Oct 07 2015 *)
  • PARI
    rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v
    eva(n) = x=0; for(k=1, #n, x=x+(n[k]*10^(#n-k))); x
    a(n) = i=0; r=rot(digits(n)); while(r!=digits(n), if(ispseudoprime(eva(r)), i++); r=rot(r)); if(ispseudoprime(eva(r)), i++); i

A372055 For a positive number k, let L(k) denote the list consisting of k followed by the prime factors of k, with repetition, in nondecreasing order; sequence gives k such that the digits of L(k) are in nondecreasing order.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 12, 25, 35, 111, 112, 125, 222, 245, 333, 335, 445, 1225, 2225, 11125, 33445, 334445, 3333335, 3334445, 3444445, 33333445, 333333335, 334444445, 3333333335, 33333334445, 333333333335, 33333333334445, 33333333444445, 444444444444445, 2222222222222225
Offset: 1

Views

Author

Keywords

Comments

This is the union of {1,2,3,5,7}, A004022, and A372029.

Examples

			L(1) = [1], L(2) = [2,2], L(11) = [11,11], L(12) = [12,2,2,3].
See A372029 for further examples.
The prime k = 1111111111111111111 = A004022(2) will eventually be a term, since L(1111111111111111111) = [1111111111111111111,1111111111111111111], which certainly has digits in nondecreasing order.
		

Crossrefs

Extensions

More terms from Michael S. Branicky, Apr 23 2024 using A004022 and A372029.

A046412 Lengths of nonsquarefree repunits.

Original entry on oeis.org

9, 18, 22, 27, 36, 42, 44, 45, 54, 63, 66, 72, 78, 81, 84, 88, 90, 99, 108, 110, 111, 117, 126, 132, 135, 144, 153, 154, 156, 162, 168, 171, 176, 180, 189, 198, 205, 207, 210, 216, 220, 222, 225, 234, 242, 243, 252, 261, 264, 270, 272, 279, 286, 288, 294, 297, 306, 308, 312, 315, 324, 330, 333, 336, 342, 351, 352
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1998

Keywords

Comments

This is the set of all positive multiples of all positive members of A087094. What is the asymptotic density of this set? - Jeppe Stig Nielsen, Dec 28 2015

Crossrefs

Programs

  • Maple
    remove(t -> numtheory:-issqrfree((10^t-1)/9), [$1..90]); # Robert Israel, Dec 30 2015
  • Mathematica
    Select[Range[300],!SquareFreeQ[(10^#-1)/9]&] (* Harvey P. Dale, Jun 26 2013 *)
  • PARI
    isok(n) = ! issquarefree((10^n-1)/9); \\ Michel Marcus, Dec 31 2015

Formula

a(n)=k where (10^k-1)/9 is not squarefree. - Ray Chandler, Aug 10 2003

Extensions

Terms to a(60) from Ray Chandler, Aug 10 2003
a(61)-a(67) from Max Alekseyev, Apr 29 2022

A069869 Largest prime that is a concatenation of the parts of a partition of n, or 0 if no such prime exists.

Original entry on oeis.org

0, 11, 3, 211, 2111, 0, 112111, 1111211, 0, 11131111, 1121111111, 0, 111211111111, 2111111111111, 0, 31111111111111, 212111111111111, 0, 1111111111111111111, 2111111111111111111, 0, 111111111111111121111, 11111111111111111111111, 0, 211111111111111111111111
Offset: 1

Views

Author

Amarnath Murthy, Apr 21 2002

Keywords

Comments

Conjecture: a(n) = 0 only for n = 1 or n = 3k with k>1.

Examples

			a(4) = 211 as the partitions of 4 are (4), (3,1), (2,2), (2,1,1) (1,1,1,1). The primes that can be formed are 13, 31, 211 and 211 is the largest prime using a partition.
		

Crossrefs

Programs

  • Maple
    with(combinat):
    a:= proc(n) local k, w;
          if n=1 or n>3 and irem(n, 3)=0 then return 0 fi;
          for k from 0 do w:= max(select(isprime,
            map(x-> parse(cat(x[])), [seq(permute(i)[],
              i=map(x->[x[], 1$(n-k)], partition(k)))]))[]);
            if w>0 then return w fi
          od
        end:
    seq(a(n), n=1..30);  # Alois P. Heinz, May 25 2013
  • Mathematica
    f[n_] := If[ PrimeQ@n, n, If[n > 5 && Mod[n, 3] == 0, 0, Block[{len = PartitionsP[n], p = IntegerPartitions[n], t = {}}, Do[ AppendTo[t, Select[FromDigits /@ Join @@@ IntegerDigits /@ Permutations@p[[i]], PrimeQ@# &]], {i, len}]; t = Union@Flatten@t; If[Length@t > 0, Max@t, 0]] ]]; Array[f, 29]
  • Python
    from collections import Counter
    from operator import itemgetter
    from sympy.utilities.iterables import partitions, multiset_permutations
    from sympy import isprime
    def A069869(n):
        smax, m = 0, 0
        if n==3 or n%3:
            for s, p in sorted(partitions(n,size=True),key=itemgetter(0),reverse=True):
                if s0:
                    smax=s
        return m # Chai Wah Wu, Feb 21 2024

Extensions

More terms from David Wasserman, Apr 30 2003
a(8) corrected and a(16)-a(24) added by Robert G. Wilson v, Feb 06 2006
a(25) from Alois P. Heinz, May 25 2013

A165210 Primes of the form (6^m - 1)/5.

Original entry on oeis.org

7, 43, 55987, 7369130657357778596659, 3546245297457217493590449191748546458005595187661976371
Offset: 1

Views

Author

Rick L. Shepherd, Sep 07 2009

Keywords

Comments

Prime repunits in base 6 whose representation consists of m 1's. The exponents m are in A004062. a(5) and a(6) have 55 and 99 decimal digits, respectively.

Examples

			a(2) = (6^A004062(2) - 1)/5 = (6^3 - 1)/5 = 215/5 = 43, which is 111_6.
		

Crossrefs

Programs

  • Magma
    [a: n in [1..200] | IsPrime(a) where a is  (6^n-1) div 5 ]; // Vincenzo Librandi, Dec 09 2011
  • Mathematica
    Select[Table[(6^n-1)/5, {n,0,2000}], PrimeQ] (* Vincenzo Librandi, Dec 09 2011 *)

Formula

a(n) = (6^A004062(n) - 1)/5.
Previous Showing 31-40 of 119 results. Next