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

A077575 a(n) = A077573(n)/prime(n).

Original entry on oeis.org

0, 37, 0, 15873, 1, 8547, 65359477124183, 5847953216374269, 48309178743961352657, 38314176245210727969348659, 3584229390681, 3, 271, 2583979328165374677, 23640661938534278959810874704491725768321513
Offset: 1

Views

Author

Amarnath Murthy, Nov 11 2002

Keywords

Comments

Product a(n)*Prime(n) = a repunit.

References

  • Amarnath Murthy, On the divisors of Smarandache Unary Sequence. Smarandache Notions Journal, Vol. 11, 2000.

Crossrefs

Extensions

More terms from Ray G. Opao, Nov 02 2004

A071126 Length of least repunit which is a multiple of the n-th prime, or 0 if no such multiple exists.

Original entry on oeis.org

0, 3, 0, 6, 2, 6, 16, 18, 22, 28, 15, 3, 5, 21, 46, 13, 58, 60, 33, 35, 8, 13, 41, 44, 96, 4, 34, 53, 108, 112, 42, 130, 8, 46, 148, 75, 78, 81, 166, 43, 178, 180, 95, 192, 98, 99, 30, 222, 113, 228, 232, 7, 30, 50, 256, 262, 268, 5, 69, 28, 141, 146, 153, 155, 312, 79, 110
Offset: 1

Views

Author

Lekraj Beedassy, May 28 2002

Keywords

Comments

If prime(n) = p then a(n) is a divisor of p-1. - Amarnath Murthy, Nov 11 2002

Examples

			The 13th prime, 41, divides the repunit 11111, the smallest among all R(5k) which are multiples of 41.
		

Crossrefs

Number of 1's in A077573(n).
Cf. A000042. Apart from a(2), identical to A002371.

Programs

  • Mathematica
    Table[Function[p, If[Divisible[10, p], 0, k = {1}; While[! Divisible[ FromDigits@ k, p], AppendTo[k, 1]]; Length@ k]]@ Prime@ n, {n, 67}] (* Michael De Vlieger, May 20 2017 *)
  • Python
    from sympy import prime
    from itertools import count
    def a(n):
        if n == 1 or n == 3: return 0
        pn = prime(n)
        return next(k for k in count(1) if 10**k//9%pn == 0)
    print([a(n) for n in range(1, 68)]) # Michael S. Branicky, Jul 24 2025

A328455 Least prime p such that all digits of p*prime(n) are the same (or -1 if p does not exist).

Original entry on oeis.org

2, 2, 11, 11, 2, -1, -1, -1, -1, -1, -1, 3, 271, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4649, -1, -1, -1, -1, -1, 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
Offset: 1

Views

Author

Ivan N. Ianakiev, Oct 16 2019

Keywords

Comments

From Bernard Schott, Oct 22 2019: (Start)
Proposition:
For n >= 5, there exist terms a(n) <> -1 iff
* prime(n) is a prime repunit with m 1's and m is in A004023, then a(n) = 2, or
* prime(n) is a divisor of a semiprime repunit with m 1's and m is in A046413, then a(n) is the other prime factor of this semiprime.
Proof:
We must solve a(n) * prime(n) = repdigit = k * repunit, 1<= k <= 9, with a(n) least prime p that is solution.
According to the unicity of prime factorization, only two possibilities:
* prime(n) is repunit, then a(n) = k = 2 (smallest prime).
* prime(n) is not a repunit, then a(n) * prime(n) must be a repunit that is semiprime, then k = 1 and a(n) is the other factor of this semiprime.
Some examples:
Case 1: prime(n) is a repunit.
The first few values of m are 2, 19, 23, ...
If this repunit is the k-th prime, then a(k) = 2; it is the case for prime(5) = 11 with a(5) = 2 (see example).
Case 2: prime(n) is a divisor of repunit.
The first few values of m are 3, 4, 5, 7, 11, 17, 47, 59, 71, ...
For m = 3, 111 = 3 * 37.
As 37 = prime(12), a(12) = 3 with 3 * 37 = 111.
As 3 = prime(2) and a(2) = 2 < 37, 37 is not right here.
For m = 4, 1111 = 11 * 101.
As 101 = prime(26), a(26) = 11 with 11 * 101 = 11111.
As 11 = prime(5) and a(5) = 2 < 101, 101 is not right here.
For m = 5, 11111 = 41 * 271, so as prime(13) = 41 and prime(58) = 271, then a(13) = 271, and (58) = 41.
For m = 7, 1111111 = 239 * 4649, so a(52) = 4649 and a(628) = 239.
(End)
a(n) is positive for n in {1,2,3,4,5,12,13,26,52,58,628,2431,2968,42536,...}. - Ivan N. Ianakiev, Oct 26 2019
If n > 4, a(n) = 2 if A077573(n) = prime(n), A077573(n)/prime(n) if that is prime, otherwise -1. - Robert Israel, Nov 19 2019

Examples

			Prime(5) is 11 and the least prime p such that all the digits of p*prime(5) are the same is 2 (as 2*11 = 22).
a(6) = -1 as repdigits are of the form k*(10^m - 1)/9, 1 <= k <= 9. We need the repdigit to be a semiprime of the form 13*p for some prime p. We need m = 6*t for some t >= 1. So (7*13) || (10^m - 1)/9, i.e., (10^m - 1)/9 can't be a semiprime and a(6) = -1. - _David A. Corneth_, Oct 16 2019
		

Programs

  • Maple
    f:= proc(n) local o,p,q;
      p:= ithprime(n);
      o:= numtheory:-order(10,p);
      q:= (10^o-1)/(9*p);
      if isprime(q) then q elif q = 1 then 2 else -1 fi
    end proc:
    2,2,11,11,seq(f(n),n=5..100); # Robert Israel, Nov 19 2019
  • Mathematica
    a[1]=a[2]=2;a[3]=a[4]=11; a[n_]:= Which[Union[IntegerDigits[Prime[n]]]=={1},2,
    Module[{i=1},While[!Divisible[(10^i-1),9*Prime[n]],i++]; k=(10^i-1)/(9*Prime[n]);
    PrimeQ[k]],k,True,-1]; a/@Range[85] (* Ivan N. Ianakiev, Oct 24 2019 *)
  • PARI
    a(n) = if(n<=5, return([2, 2, 11, 11, 2][n])); my(p=prime(n)); for(i=1, oo, if((10^i-1)/9%p==0, c=(10^i-1)/(9*p); if(isprime(c), return(c), return(-1)))) \\ David A. Corneth, Oct 22 2019

Extensions

More terms from Bernard Schott and David A. Corneth, Oct 22 2019
Showing 1-3 of 3 results.