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 91-100 of 106 results. Next

A319148 Irregular triangle T(n,m) where row n lists differences m = j*p - r - 1, with iterator 1 <= j <= A002110(n), p = prime(n+1), and r is the smallest number that exceeds j*p that is coprime to A002110(n+1).

Original entry on oeis.org

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

Views

Author

Jamie Morken, Sep 11 2018

Keywords

Comments

Let p(i) be primes with p(1)=2, p(n)# the n-th primorial number, and h(n) the Jacobsthal function for primorial p(n)#. Conjecture: gcd(h(n), p(n+1)) = 1.
For a multiple m of a prime n, terms in this sequence give the number of contiguous numbers starting at m+1 which have at least one prime factor < n.
Consider a range s of the first n + 1 primes. Let p be the largest of these primes, i.e., A000040(n+1). Let P be the product of the first n primes, i.e., the primorial A002110(n), and let Q be the product of all the primes in s, i.e., the primorial A002110(n+1). Consider the reduced residue system R of primorial P, that is, those numbers 1 <= r < P such that gcd(r, P) = 1; therefore R = row n of A286941. For each n, we generate the multiples k = j*p, with 1 <= j <= P. For each k, we find the smallest residue r in R that exceeds k and take the difference m = r - k - 1. If no value in R exceeds k, then we use Q + 1 (which is also coprime to Q). Row n is thus a list of these m.
Alternatively, consider a multiple k = j*p, with 1 <= j <= P. We can compute m by iterating i such that the sum (i + k) is coprime to Q and subtracting 1. This technique is more efficient in terms of memory, as it does not require storing the reduced residue system of Q.
For n > 1: The penultimate value m on row n = A040976(n). The number of values m on row n is given by the sequence: 1,1,2,2,10,22,500,...
For n > 3: For any even x = m in row n, the number of x in row n is equal to the count of y in row n where y = x + 1. If x = 0, the count of x and y in row n = A000010(A002110(n-1)). For example, on row 4, A000010(A002110(4-1)) = 8, as 0 and 1 each occur 8 times on row 4. The sequence of counts of x and x+1 pairs on consecutive rows is given by the sequence A059861. For example, for x=0 and y=1 occurring 8 times on row 4, x=2 and y=3 occur 8-3=5 times on row 4 given by the value 3 in A059861. For example, for row 8, x=0 and y=1 occur A000010(A002110(8-1)) = 92160 times on row 8, and x=2 and y=3 occur 92160-22275=69885 times on row 8 given by the value 22275 in A059861.
For 3 < n < 9: The largest value on row n occurs twice, the pattern of occurrence is shown in table 1 of Ziller & Morack in the Links section.

Examples

			Triangle begins:
  0;
  1,0;
  1,0,1,2,3,0;
  3,2,1,0,1,0,3,2,3,0,1,4,5,2,1,0,1,0,3,2,1,2,1,0,3,4,1,0,5,0;
  ...
For n = 2, we have s = {2,3,5}, with p = prime(n+1) = 5, P = A002110(2) = 6, and Q = A002110(3) = 30. Then R = row n of A286941 = {1, 7, 11, 13, 17, 19, 23, 29} (we add 31 to this list since we are concerned with the residue that is larger than the largest k and since 31 is the ensuing number coprime to Q). The series of multiples k = j*p are the multiples 5j with 1 <= j <= P, thus {5, 10, 15, 20, 25, 30}. In R, the smallest residues that exceed the multiples k in the immediately aforementioned list are {7, 11, 17, 23, 29, 31}. The differences are {7 - 5, 11 - 10, 17 - 15, 23 - 20, 29 - 25, 31 - 30} or {2, 1, 2, 3, 4, 1}; subtracting one from each we have row 2 = {1, 0, 1, 2, 3, 0}.
For example, the third value on row n=20000 is 15, so all values in the range (3 * prime(20000) + i) to (3 * prime(20000) + i) for 1 <= i <= 15 have at least one prime factor <= prime(n).
		

Crossrefs

Programs

  • Mathematica
    rowToCreate = 3; (* create row n *)
    redundantDistanceToCheck = 1; (* set to 2 or higher to see n repeating
    patterns of length primorial[rowToCreate] *)
    Primorial[n_] := Times @@ Prime[Range[n]]
    rowValue = 0;
    primeToUse = Prime[rowToCreate];
    distanceToCheck1 = redundantDistanceToCheck*Primorial[rowToCreate];
    (* distanceToCheck1=rowToCreate*10000; *)(* uncomment this second option to create the first few values in very large rows up to rowToCreate=7000000000000 *)
    For[i = primeToUse, i < distanceToCheck1 + 1, i = i + primeToUse,
    For[x = i + 1, x < distanceToCheck1 + 2, x++,
    If[FactorInteger[x][[1, 1]] < primeToUse, rowValue++; , x =
    distanceToCheck1 + 2;
    Print[rowValue];
    rowValue = 0;
    ]]] (* Jamie Morken, Sep 11 2018 *)
    (* Program to check the number of composites referenced to row
    values: *)
    Row = 100;
    ColumnOnTheRow = 12;
    Print["composites>", ColumnOnTheRow*Prime[Row], "=",
    (NextPrime[ColumnOnTheRow*Prime[Row]]) -
    (ColumnOnTheRow*Prime[Row]) - 1];
    (* Second program: *)
    Table[Block[{s = Prime@ Range[n + 1], p, P, Q}, p = Last@ s; P = Times @@
    Most@ s; Q = Times @@ s; Array[Block[{k = 1}, While[! CoprimeQ[k + p #,
    Q], k++]; k - 1] &, P]], {n, 4}] // Flatten (* Michael De Vlieger, Sep 11 2018 *)

Formula

Length of row n = A002110(n - 1).
T(n,1) = A046933(n).
Number of unique or primitive values m in row n = A048670(n-1).

A332772 Numbers k > 0 such that 30k +- 7 is prime.

Original entry on oeis.org

1, 2, 3, 4, 9, 10, 12, 13, 15, 19, 20, 25, 26, 29, 32, 33, 37, 41, 43, 48, 52, 53, 54, 58, 66, 67, 76, 78, 81, 85, 88, 89, 90, 92, 95, 97, 101, 107, 118, 120, 121, 128, 129, 134, 143, 150, 153, 155, 165, 166, 172, 178, 180, 194, 195, 202, 207, 209, 211, 212
Offset: 1

Views

Author

Frank Ellermann, Feb 25 2020

Keywords

Comments

Looking for prime factors > 5=prime(3) in 8=A005867(3) candidates mod 30=A002110(3) two candidates in the form 30k +- 7 with k > 0 never belong to a twin prime pair. Twin primes can be (30k-13, 30k-11) A331840, (30k-1, 30k +1) A176114, or (30k+11, 30k+13) A089160.

Examples

			a(4)=4 for prime(30)=113=4*30-7 and prime(31)=127=4*30+7.
a(5)=9 for prime(56)=263=9*30-7 and prime(59)=277=9*30+7.
		

Crossrefs

Subsequence of A158573. Prime pairs 30k +- 7 in A329262.

Programs

  • Mathematica
    Select[Range@ 215, AllTrue[30 # + {-7, 7}, PrimeQ] &] (* Michael De Vlieger, Feb 25 2020 *)
  • Rexx
    S = 1
    do N = 2 while length( S ) < 255
       if NOPRIME( N * 30 + 7 )   then  iterate N
       if NOPRIME( N * 30 - 7 )   then  iterate N
       S = S || ',' N
    end N
    say S

A343119 Number of compositions (ordered partitions) of the n-th primorial into distinct parts.

Original entry on oeis.org

1, 1, 11, 41867, 517934206090276988507, 42635439758725572299058305546953458030363703549127905691758491973278624456679699932948789006991639715987
Offset: 0

Views

Author

Alois P. Heinz, Apr 09 2021

Keywords

Comments

All terms are odd.

Crossrefs

Programs

  • Maple
    b:= proc(n) b(n):= `if`(n=0, 1, b(n-1)*ithprime(n)) end:
    g:= proc(n, k) option remember; `if`(k<0 or n<0, 0,
         `if`(k=0, `if`(n=0, 1, 0), g(n-k, k)+k*g(n-k, k-1)))
        end:
    a:= n-> add(g(b(n), k), k=0..floor((sqrt(8*b(n)+1)-1)/2)):
    seq(a(n), n=0..5);
  • Mathematica
    $RecursionLimit = 5000;
    b[n_] := If[n == 0, 1, b[n - 1]*Prime[n]];
    g[n_, k_] := g[n, k] = If[k < 0 || n < 0, 0,
         If[k == 0, If[n == 0, 1, 0], g[n - k, k] + k*g[n - k, k - 1]]];
    a[n_] := Sum[g[b[n], k], {k, 0, Floor[(Sqrt[8*b[n] + 1] - 1)/2]}];
    Table[a[n], {n, 0, 5}] (* Jean-François Alcover, Apr 14 2022, after Alois P. Heinz *)

Formula

a(n) = A032020(A002110(n)).

A355036 a(n) is the least number whose product of digits in primorial base equals n.

Original entry on oeis.org

0, 1, 5, 21, 17, 159, 23, 1509, 29, 111, 161, 25659, 83, 392949, 1511, 171, 89, 8711259, 113, 184837209, 167, 1521, 25661, 5141378799, 119, 1209, 392951, 741, 1517, 187854439329, 173, 6224078222919, 149, 25671, 8711261, 1629, 203, 274774574506989, 184837211
Offset: 0

Views

Author

Rémy Sigrist, Jun 16 2022

Keywords

Comments

All terms except a(0) = 0 are odd.
Each prime number sets a new record.

Examples

			The first terms, alongside their primorial base expansion, are:
  n   a(n)       pr(a(n))
  --  ---------  ------------------
   0          0                   0
   1          1                   1
   2          5                 2_1
   3         21               3_1_1
   4         17               2_2_1
   5        159             5_1_1_1
   6         23               3_2_1
   7       1509           7_1_1_1_1
   8         29               4_2_1
   9        111             3_3_1_1
  10        161             5_1_2_1
  11      25659        11_1_1_1_1_1
  12         83             2_3_2_1
  13     392949      13_1_1_1_1_1_1
		

Crossrefs

Cf. A005867, A057588, A263130 (factorial base analog), A355037.

Programs

  • PARI
    a(n) = { if (n==0, 0, my (v=0, f=1); forprime (r=2, oo, forstep (d=r-1, 1, -1, if (n%d==0, v+=f*d; n/=d; break;);); if (n==1, return (v), f*=r))) }

Formula

A355037(a(n)) = n.
a(A005867(n)) = A057588(n) for any n > 0.

A359632 Sequence of gaps between deletions of multiples of 7 in step 4 of the sieve of Eratosthenes.

Original entry on oeis.org

12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3, 12, 7, 4, 7, 4, 7, 12, 3
Offset: 1

Views

Author

Alexandre Herrera, Jan 08 2023

Keywords

Comments

This sequence is a repeating cycle 12, 7, 4, 7, 4, 7, 12, 3 of length A005867(4) = 8 = (prime(1)-1)*(prime(2)-1)*(prime(3)-1).
The mean of the cycle is prime(4) = 7.
The cycle is constructed from the sieve of Eratosthenes as follows.
In the first 2 steps of the sieve, the gaps between the deleted numbers are constant: gaps of 2 in step 1 when we delete multiples of 2, and gaps of 3 in step 2 when we delete multiples of 3.
In step 3, when we delete all multiples of 5, the gaps are alternately 7 and 3 (i.e., cycle [7,3]).
For this sequence, we look at the interesting cycle from step 4 (multiples of 7).
Excluding the final 3, the cycle has reflective symmetry: 12, 7, 4, 7, 4, 7, 12. This is true for every subsequent step of the sieve too.
The central element is 7 (BUT not all steps have their active prime number as the central element).
a(1) is A054272(4).
a(8) = 3, the first appearance of the last element of the cycle, corresponds to deletion of 217 = A002110(4)+7.

Examples

			After sieve step 3, multiples of 2,3,5 have been eliminated leaving
  7,11,13,17,19,23,29,31,37,41,43,47,49,53, ...
  ^                                   ^
The first two multiples of 7 are 7 itself and 49 and they are distance 12 apart in the list so that a(1) = 12.
For n = 2, a(n) = 7, because the third multiple of 7 that is not a multiple of 2, 3 or 5 is 77 = 7 * 11, which is located 7 numbers after 49 = 7*7 in the list of numbers without the multiples of 2, 3 and 5.
		

Crossrefs

Equivalent sequences for steps 1..3: A007395, A010701, A010705 (without the initial 3).

Programs

  • Mathematica
    PadRight[{}, 100, {12, 7, 4, 7, 4, 7, 12, 3}] (* Paolo Xausa, Jul 01 2024 *)
  • Python
    numbers = []
    for i in range(2,880):
        numbers.append(i)
    gaps = []
    step = 4
    current_step = 1
    while current_step <= step:
        prime = numbers[0]
        new_numbers = []
        gaps = []
        gap = 0
        for i in range(1,len(numbers)):
            gap += 1
            if numbers[i] % prime != 0:
                new_numbers.append(numbers[i])
            else:
                gaps.append(gap)
                gap = 0
        current_step += 1
        numbers = new_numbers
    print(gaps)

Formula

a(n) = A236175(n)+1. - Peter Munn, Jan 21 2023

A381287 a(n) is the smallest nonnegative number congruent to k modulo prime(k)^(n-k+1) for k=1..n.

Original entry on oeis.org

1, 5, 353, 65153, 119966753, 3050486978753, 563678198162618753, 15413934869729743026218753, 1710386933322832904060816574218753, 14712401204424400291787297607394206774218753, 5027982881016562571248237683551040219315980699574218753, 5488604004979149030407333271782173318791620565366546226763574218753
Offset: 1

Views

Author

Steven Lu, Feb 19 2025

Keywords

Comments

This sequence is an example demonstrating how an integer sequence (thus a rational number sequence) converges to distinct limits in all p-adic systems; that is, converges to 1 in 2-adic, to 2 in 3-adic, to k in prime(k)-adic, and so on.
Moreover, the rational number sequence a(n) / prime(n+1) ^ (primorial(n)^(n-1) * A005867(n)) converges to distinct limits in all p-adic systems as well as the real number system, with limit zero in real numbers, and limit k in prime(k)-adic, where k is any positive integer.

Examples

			For n=3, a(3)=353 since 353 is the smallest nonnegative integer x satisfying:
  x == 1 (mod 2^3),
  x == 2 (mod 3^2),
  x == 3 (mod 5^1).
		

Crossrefs

Programs

  • Mathematica
    ToString[Table[ChineseRemainder[Range[n], (Prime /@ Range[n])^Range[n, 1, -1]], {n, 12}]]

A382789 The number of prime factors of Euler phi of the n-th primorial number, counted with multiplicity.

Original entry on oeis.org

0, 0, 1, 3, 5, 7, 10, 14, 17, 19, 22, 25, 29, 33, 36, 38, 41, 43, 47, 50, 53, 58, 61, 63, 67, 73, 77, 80, 82, 87, 92, 96, 99, 103, 106, 109, 113, 117, 122, 124, 127, 129, 134, 137, 144, 148, 152, 156, 159, 161, 165, 169, 172, 178, 182, 190, 192, 195, 200, 204
Offset: 0

Views

Author

Amiram Eldar, Apr 05 2025

Keywords

Crossrefs

Partial sums of A023508.

Programs

  • Mathematica
    Join[{0}, Accumulate[PrimeOmega[Prime[Range[100]] - 1]]]
  • PARI
    list(nmax) = {my(s = 0, c = 0); print1(s, ", "); forprime(p = 1, , c++; s += bigomega(p-1); print1(s, ", "); if(c == nmax, break));}

Formula

a(n) = A001222(A000010(A002110(n))).
a(n) = A001222(A005867(n)).
a(n) = Sum_{k=1..n} A023508(k).

A048980 Difference between number of nonprimes and primes in reduced residue system of primorial numbers.

Original entry on oeis.org

1, 1, 0, -6, -36, -196, -724, 7512, 366838, 11928316, 421130508, 14598816402, 584642184936, 25314953837836, 1128885572358548, 54492272309366314, 2950485568862138250, 213151926413154110951
Offset: 0

Views

Author

Keywords

Examples

			n=4, Q(4)=2*3*5*7=210, reduced residue system includes 48 terms:42 primes and 6 composites and 1: a(4)=6-42=-36.
		

Crossrefs

Programs

  • Mathematica
    Table[Function[P, EulerPhi@ P - 2 # &[PrimePi@ P - n]]@ Product[Prime@ i, {i, n}], {n, 0, 12}] (* Michael De Vlieger, May 08 2017 *)

Formula

a(n) = A048863(n) - A048862(n) = A048866(A002110(n)).
a(n) = A005867(n) - 2*A000849(n) + 2*n.

Extensions

Corrected and extended by Max Alekseyev, Feb 22 2016

A066264 Number of composites < primorial(p) with all prime factors > p.

Original entry on oeis.org

0, 0, 0, 5, 141, 2517, 49835, 1012858, 24211837, 721500293, 22627459400, 844130935667, 34729870646917, 1491483322755273, 69890000837179156
Offset: 1

Views

Author

Patrick De Geest, Dec 10 2001

Keywords

Comments

There is a simple relationship between this sequence and the number of primes < primorial(p), as given by A000849 and sequence A005867 which gives the number of composites in primorial(p+1) having (p+1) as their lowest prime factor: a(n) = n + A005867(n) - A000849(n) - 1. - Dennis Martin (dennis.martin(AT)dptechnology.com), Apr 15 2007

Examples

			There are 5 composites < primorial(7) or 210 and whose prime factors are all larger than 7: 121 (11*11), 143 (11*13), 169 (13*13), 187 (11*17) and 209 (11*19).
		

Crossrefs

Programs

  • Mathematica
    Array[#1 + EulerPhi@ #2 - PrimePi@ #2 - 1 & @@ {#, Product[Prime@ i, {i, #}]} &, 12] (* Michael De Vlieger, Apr 03 2019 *)

Formula

a(n) = n + A005867(n) - A000849(n) - 1. - Michael De Vlieger, Apr 03 2019, citing Dennis Martin's comment above.

Extensions

More terms from Dennis Martin (dennis.martin(AT)dptechnology.com), Apr 15 2007
Offset corrected by Charles J. Daniels (chajadan(AT)gmail.com), Dec 06 2009
a(14)-a(15) from Donovan Johnson, May 03 2010

A234299 a(n) = |A| is the smallest order of a set A of consecutive integers which has Euler-phi(3*5*7*11*...*Pn) members coprime to 3*5*7*..*Pn, where Pn is the n-th odd prime.

Original entry on oeis.org

2, 13, 101, 1149, 15005, 255243, 4849829, 111546416, 3234846593, 100280245037, 3710369067373, 152125131763569, 6541380665834971, 307444891294245656, 16294579238595022313, 961380175077106319477, 58644190679703485491570, 3929160775540133527939470
Offset: 1

Views

Author

John F. Morack, Dec 22 2013

Keywords

Comments

The sequence is strongly associated with A072752.
In A072752, you are looking for a maximum sized set of consecutive numbers where none are counted by Euler's phi(3*5*7*...*Pn); this sequence looks for a minimum sized set of consecutive numbers where all the numbers counted by Euler are included.
One candidate for A (not necessarily of minimum size) is the set {1, 2, 3,..., 3*5*..*Pn}, which has the requested number of coprime elements. This yields the simple upper bound a(n) <= A070826(n+1). - R. J. Mathar, May 03 2017

Examples

			a(1)=2,  phi(3) = 2, A={1,2 }, B={1,2}, |B|=2  gcd(1,3) = 1; gcd(2,3) = 1; minimum(|A|) = 2.
a(2)=13, phi(3*5) = 8, A={7,8,9,10,...,19}, B={7, 8, 11, 13, 14, 16, 17, 19}, |B|=8, A was chosen so |A| is a minimum.
		

Crossrefs

Formula

Let A = { set of any k consecutive integers}, |A| its size.
Let B = {x IN A | gcd(x, 3*5*7...Prime(n))=1}.
Condition: |B| = phi(3*5*7...Prime(n))= A005867(n+1).
a(n) = minimum(|A|) which meets the above condition.
a(n) = A070826(n+1) - A072752(n+1).

Extensions

Edited by R. J. Mathar, May 03 2017
Previous Showing 91-100 of 106 results. Next