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-10 of 12 results. Next

A345531 Smallest prime power greater than the n-th prime.

Original entry on oeis.org

3, 4, 7, 8, 13, 16, 19, 23, 25, 31, 32, 41, 43, 47, 49, 59, 61, 64, 71, 73, 79, 81, 89, 97, 101, 103, 107, 109, 113, 121, 128, 137, 139, 149, 151, 157, 163, 167, 169, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 243, 256, 263, 269, 271, 277
Offset: 1

Views

Author

Dario T. de Castro, Jun 20 2021

Keywords

Comments

Take the family of correlated prime-indexed conjectures appearing in A343249 - A343253, in which an alternative formula for the p-adic order of positive integers is proposed. There, the general p-indexed conjecture says that v_p(n), the p-adic order of n, is given by the formula: v_p(n) = log_p(n / L_p(k0, n)), where L_p(k0, n) is the lowest common denominator of the elements of the set S_p(k0, n) = {(1/n)*binomial(n, k), with 0 < k <= k0 such that k is not divisible by p}. Evidence suggests that the primality of p is a necessary condition in this general conjecture. So, if a composite number q is used instead of a prime p in the proposed formula for the p-adic (now, q-adic) order of n, the first counterexample (failure) is expected to occur for n = q * a(i), where i is the index of the smallest prime that divides q.
The prime-power a(n) is at most the next prime, so this sequence is strictly increasing. See also A366833. - Gus Wiseman, Nov 06 2024

Examples

			a(4) = 8 because the fourth prime number is 7, and the least power of a prime which is greater than 7 is 2^3 = 8.
		

Crossrefs

Starting with n instead of prime(n): A000015, A031218, A377468, A377780, A377782.
Opposite (greatest prime-power less than): A065514, A377289, A377781.
For squarefree instead of prime-power: A112926, opposite A112925.
The difference from prime(n) is A377281.
The prime terms have indices A377286(n) - 1.
First differences are A377703.
A version for perfect-powers is A378249.
A000961 and A246655 list the prime-powers, differences A057820.
A024619 and A361102 list the non-prime-powers, differences A375735.

Programs

  • Maple
    f:= proc(n) local p,x;
      p:= ithprime(n);
      for x from p+1 do
        if nops(numtheory:-factorset(x)) = 1 then return x fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Aug 25 2024
  • Mathematica
    a[i_]:= Module[{j, k, N = 0, tab={}}, tab = Sort[Drop[DeleteDuplicates[Flatten[Table[ If[Prime[j]^k > Prime[i], Prime[j]^k], {j, 1, i+1}, {k, 1, Floor[Log[Prime[j], Prime[i+1]]]}]]], 1]]; N = Take[tab, 1][[1]]; N];
    tabseq = Table[a[i],{i, 1, 100}];
    (* second program *)
    Table[NestWhile[#+1&,Prime[n]+1, Not@*PrimePowerQ],{n,100}] (* Gus Wiseman, Nov 06 2024 *)
  • PARI
    A000015(n) = for(k=n,oo,if((1==k)||isprimepower(k),return(k)));
    A345531(n) = A000015(1+prime(n)); \\ Antti Karttunen, Jul 19 2021
    
  • Python
    from itertools import count
    from sympy import prime, factorint
    def A345531(n): return next(filter(lambda m:len(factorint(m))<=1, count(prime(n)+1))) # Chai Wah Wu, Oct 25 2024

Formula

a(n) = A000015(1+A000040(n)). - Antti Karttunen, Jul 19 2021
a(n) = A000015(A008864(n)). - Omar E. Pol, Oct 27 2021

A377781 First differences of A065514(n) = greatest number < prime(n) that is 1 or a prime-power.

Original entry on oeis.org

1, 2, 1, 4, 2, 5, 1, 2, 8, 2, 3, 5, 4, 2, 6, 4, 6, 5, 3, 4, 2, 8, 2, 6, 8, 4, 2, 4, 2, 16, 3, 3, 6, 2, 10, 2, 6, 6, 6, 4, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 4, 13, 1, 6, 6, 2, 6, 4, 8, 4, 14, 4, 2, 4, 14, 12, 4, 2, 4, 8, 6, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10
Offset: 1

Views

Author

Gus Wiseman, Nov 14 2024

Keywords

Comments

Note 1 is a power of a prime but not a prime-power.

Crossrefs

Differences of A065514, which is the restriction of A031218 (differences A377782).
The opposite is A377703 (restriction of A000015), differences of A345531.
The opposite for nonsquarefree is A377784, differences of A377783.
For nonsquarefree we have A378034, differences of A378032 (restriction of A378033).
The opposite for squarefree is A378037, differences of A112926 (restriction of A067535).
For squarefree we have A378038, differences of A112925 (restriction of A070321).
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime-powers, differences A057820.
A024619 lists the non-prime-powers, differences A375735, seconds A376599.
A361102 lists the non-powers of primes, differences A375708.
Prime-powers between primes:
- A053607 primes
- A080101 count (exclusive)
- A304521 by bits
- A366833 count
- A377057 positive
- A377286 zero
- A377287 one
- A377288 two

Programs

  • Mathematica
    Differences[Table[NestWhile[#-1&,Prime[n]-1,#>1&&!PrimePowerQ[#]&],{n,100}]]

A378371 Distance between n and the least non prime power >= n, allowing 1.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 28 2024

Keywords

Comments

Non prime powers allowing 1 (A361102) are numbers that are not a prime power (A246655), namely 1, 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, ...

Examples

			The least non prime power >= 4 is 6, so a(4) = 2.
		

Crossrefs

Sequences obtained by adding n to each term are placed in parentheses below.
For prime we have A007920 (A151800), strict A013632.
For composite we have A010051 (A113646 except initial terms).
For perfect power we have A074984 (A377468)
For squarefree we have A081221 (A067535).
For nonsquarefree we have (A120327).
For non perfect power we have A378357 (A378358).
The opposite version is A378366 (A378367).
For prime power we have A378370, strict A377282 (A000015).
This sequence is A378371 (A378372).
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057.

Programs

  • Mathematica
    Table[NestWhile[#+1&,n,PrimePowerQ[#]&]-n,{n,100}]

Formula

a(n) = A378372(n) - n.

A378370 Distance between n and the least prime power >= n, allowing 1.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 27 2024

Keywords

Comments

Prime powers allowing 1 are listed by A000961.

Crossrefs

Sequences obtained by adding n to each term are placed in parentheses below.
For prime instead of prime power we have A007920 (A007918), strict A013632.
For perfect power we have A074984 (A377468), opposite A069584 (A081676).
For squarefree we have A081221 (A067535).
The restriction to the prime numbers is A377281 (A345531).
The strict version is A377282 = a(n) + 1.
For non prime power instead of prime power we have A378371 (A378372).
The opposite version is A378457, strict A276781.
A000015 gives the least prime power >= n, opposite A031218.
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
A151800 gives the least prime > n.
Prime-powers between primes: A053607, A080101, A304521, A366833, A377057.

Programs

  • Mathematica
    Table[NestWhile[#+1&,n,#>1&&!PrimePowerQ[#]&]-n,{n,100}]

Formula

a(n) = A000015(n) - n.
a(n) = A377282(n - 1) - 1 for n > 1.

A343250 a(n) is the least k0 <= n such that v_3(n), the 3-adic order of n, can be obtained by the formula: v_3(n) = log_3(n / L_3(k0, n)), where L_3(k0, n) is the lowest common denominator of the elements of the set S_3(k0, n) = {(1/n)*binomial(n, k), with 0 < k <= k0 such that k is not divisible by 3} or 0 if no such k0 exists.

Original entry on oeis.org

1, 2, 1, 4, 5, 2, 7, 8, 1, 5, 11, 4, 13, 7, 5, 16, 17, 2, 19, 5, 7, 11, 23, 8, 25, 13, 1, 7, 29, 5, 31, 32, 11, 17, 7, 4, 37, 19, 13, 8, 41, 7, 43, 11, 5, 23, 47, 16, 49, 25, 17, 13, 53, 2, 11, 8, 19, 29, 59, 5, 61, 31, 7, 64, 13, 11, 67, 17, 23, 7, 71, 8, 73, 37, 25, 19, 11, 13, 79, 16
Offset: 1

Views

Author

Dario T. de Castro, Apr 09 2021

Keywords

Comments

Conjecture: a(n) is the greatest power of a prime different from 3 that divides n.

Examples

			For n = 10, a(10) = 5. To understand this result, consider the largest set S_3, which is the S_3(k0=10, 10). According to the definition, S_3(n, n) is the set of elements of the form (1/n)*binomial(n, k), where k goes from 1 to n, skipping the multiples of 3. The elements of S_3(10, 10) are: {1, 9/2, 0, 21, 126/5, 0, 12, 9/2, 0, 1/10}, where the zeros were put pedagogically to identify the skipped terms, i.e., when k is divisible by 3. At this point we verify which of the nested subsets {1}, {1, 9/2}, {1, 9/2, 0}, {1, 9/2, 0, 21}, {1, 9/2, 0, 21, 126/5},... will match for the first time the p-adic order’s formula. If k vary from 1 to 5 (instead of 10) we see that the lowest common denominator of the set S_3(5, 10) will be 10. So, L_3(5, 10) = 10 and the equation v_3(10) = log_3(10/10) yields a True result. Then we may say that a(10) = 5 specifically because 5 was the least k0.
		

Crossrefs

Programs

  • Mathematica
    j = 2;
    Nmax = 250;
    Array[val, Nmax];
    Do[val[i] = 0, {i, 1, Nmax}];
    Do[flag = 0;
      Do[If[(flag == 0 &&
          Prime[j]^IntegerExponent[n, Prime[j]] ==
           n/LCM[Table[
               If[Divisible[k, Prime[j]], 1,
                Denominator[(1/n) Binomial[n, k]]], {k, 1, k}] /.
              List -> Sequence]), val[n] = k; flag = 1;, Continue], {k, 1,
         n, 1}], {n, 1, Nmax}];
    tabseq = Table[val[i], {i, 1, Nmax}];
    (* alternate code *)
    a[n_] := Module[{k = 1, v = IntegerExponent[n, 3]}, While[Log[3, n/LCM @@ Denominator[Binomial[n, Select[Range[k], ! Divisible[#, 3] &]]/n]] != v, k++]; k]; Array[a, 100] (* Amiram Eldar, Apr 23 2021 *)
  • PARI
    Lp(k, n, p) = {my(list = List()); for (i=1, k, if (i%p, listput(list, binomial(n,i)/n));); lcm(apply(denominator, Vec(list)));}
    isok(k, n, v, p) = p^v == n/Lp(k, n, p);
    a(n, p=3) = {my(k=1, v=valuation(n, p)); for (k=1, n, if (isok(k, n, v, p), return(k)););} \\ Michel Marcus, Apr 22 2021

A343251 a(n) is the least k0 <= n such that v_5(n), the 5-adic order of n, can be obtained by the formula: v_5(n) = log_5(n / L_5(k0, n)), where L_5(k0, n) is the lowest common denominator of the elements of the set S_5(k0, n) = {(1/n)*binomial(n, k), with 0 < k <= k0 such that k is not divisible by 5} or 0 if no such k0 exists.

Original entry on oeis.org

1, 2, 3, 4, 1, 3, 7, 8, 9, 2, 11, 4, 13, 7, 3, 16, 17, 9, 19, 4, 7, 11, 23, 8, 1, 13, 27, 7, 29, 3, 31, 32, 11, 17, 7, 9, 37, 19, 13, 8, 41, 7, 43, 11, 9, 23, 47, 16, 49, 2, 17, 13, 53, 27, 11, 8, 19, 29, 59, 4, 61, 31, 9, 64, 13, 11, 67, 17, 23, 7, 71, 9, 73, 37, 3, 19, 11, 13, 79, 16
Offset: 1

Views

Author

Dario T. de Castro, Apr 09 2021

Keywords

Comments

Conjecture: a(n) is the greatest power of a prime different from 5 that divides n.

Examples

			For n = 12, a(12) = 4. To understand this result, consider the largest set S_5, which is the S_5(k0=12, 12). According to the definition, S_5(n, n) is the set of elements of the form (1/n)*binomial(n, k), where k goes from 1 to n, skipping the multiples of 5. The elements of S_5(12, 12) are {1, 11/2, 55/3, 165/4, 0, 77, 66, 165/4, 55/3, 0, 1, 1/12}, where the zeros were inserted pedagogically to identify the skipped terms, i.e., when k is divisible by 5. At this point we verify which of the nested subsets {1}, {1, 11/2}, {1, 11/2, 55/3}, {1, 11/2, 55/3, 165/4}, ... will match for the first time the p-adic order's formula. If k varies from 1 to 4 (instead of 12) we see that the lowest common denominator of the set S_5(4, 12) will be 12. So, L_5(4, 12) = 12 and the equation v_5(12) = log_5(12/12) yields a True result. Then we may say that a(12) = 4 specifically because 4 was the least k0.
		

Crossrefs

Programs

  • Mathematica
    j = 3;
    Nmax = 250;
    Array[val, Nmax];
    Do[val[i] = 0, {i, 1, Nmax}];
    Do[flag = 0;
      Do[If[(flag == 0 &&
          Prime[j]^IntegerExponent[n, Prime[j]] ==
           n/LCM[Table[
               If[Divisible[k, Prime[j]], 1,
                Denominator[(1/n) Binomial[n, k]]], {k, 1, k}] /.
              List -> Sequence]), val[n] = k; flag = 1;, Continue], {k, 1,
         n, 1}], {n, 1, Nmax}];
    tabseq = Table[val[i], {i, 1, Nmax}];
    (* alternate code *)
    a[n_] := Module[{k = 1, v = IntegerExponent[n, 5]}, While[Log[5, n/LCM @@ Denominator[Binomial[n, Select[Range[k], ! Divisible[#, 5] &]]/n]] != v, k++]; k]; Array[a, 100] (* Amiram Eldar, Apr 23 2021 *)
  • PARI
    Lp(k, n, p) = {my(list = List()); for (i=1, k, if (i%p, listput(list, binomial(n,i)/n));); lcm(apply(denominator, Vec(list)));}
    isok(k, n, v, p) = p^v == n/Lp(k, n, p);
    a(n, p=5) = {my(k=1, v=valuation(n, p)); for (k=1, n, if (isok(k, n, v, p), return(k)););} \\ Michel Marcus, Apr 23 2021

A377782 First-differences of A031218(n) = greatest number <= n that is 1 or a prime-power.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 16 2024

Keywords

Comments

Note 1 is a power of a prime (A000961) but not a prime-power (A246655).

Crossrefs

Positions of 1 are A006549.
Positions of 0 are A080765 = A024619 - 1, complement A181062 = A000961 - 1.
Positions of 2 are A120432 (except initial terms).
Sorted positions of first appearances appear to include A167236 - 1.
Positions of terms > 1 are A373677.
The restriction to primes minus 1 is A377289.
Below, A (B) indicates that A is the first-differences of B:
- This sequence is A377782 (A031218), which has restriction to primes A065514 (A377781).
- The opposite is A377780 (A000015), restriction A377703 (A345531).
- For nonsquarefree we have A378036 (A378033), opposite A378039 (A120327).
- For squarefree we have A378085 (A112925), restriction A378038 (A070321).
A000040 lists the primes, differences A001223.
A000961 and A246655 list prime-powers, differences A057820.
A024619 lists the non-prime-powers, differences A375735, seconds A376599.
A361102 lists the non-powers of primes, differences A375708.
A378034 gives differences of A378032 (restriction of A378033).
Prime-powers between primes: A053607, A080101, A366833, A377057, A377286, A377287.

Programs

  • Mathematica
    Differences[Table[NestWhile[#-1&,n,#>1&&!PrimePowerQ[#]&],{n,100}]]

A343252 a(n) is the least k0 <= n such that v_7(n), the 7-adic order of n, can be obtained by the formula: v_7(n) = log_7(n / L_7(k0, n)), where L_7(k0, n) is the lowest common denominator of the elements of the set S_7(k0, n) = {(1/n)*binomial(n, k), with 0 < k <= k0 such that k is not divisible by 7} or 0 if no such k0 exists.

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 1, 8, 9, 5, 11, 4, 13, 2, 5, 16, 17, 9, 19, 5, 3, 11, 23, 8, 25, 13, 27, 4, 29, 5, 31, 32, 11, 17, 5, 9, 37, 19, 13, 8, 41, 3, 43, 11, 9, 23, 47, 16, 1, 25, 17, 13, 53, 27, 11, 8, 19, 29, 59, 5, 61, 31, 9, 64, 13, 11, 67, 17, 23, 5, 71, 9, 73, 37, 25, 19, 11, 13, 79, 16
Offset: 1

Views

Author

Dario T. de Castro, May 31 2021

Keywords

Comments

Conjecture: a(n) is the greatest power of a prime different from 7 that divides n.

Examples

			For n = 10, a(10) = 5. To understand this result, consider the largest set S_7, which is the S_7(k0=10, 10). According to the definition, S_7(n, n) is the set of elements of the form (1/n)*binomial(n, k), where k goes from 1 to n, skipping the multiples of 7. The elements of S_7(10, 10) are {1, 9/2, 12, 21, 126/5, 21, 0, 9/2, 1, 1/10}, where the zero was inserted pedagogically to identify the skipped term, i.e., when k is divisible by 7. At this point we verify which of the nested subsets {1}, {1, 9/2}, {1, 9/2, 12}, {1, 9/2, 12, 21}, ... will match for the first time the p-adic order's formula. If k varies from 1 to 5 (instead of 10) we see that the lowest common denominator of the set S_7(5, 10) will be 10. So, L_7(5, 10) = 10 and the equation v_7(10) = log_7(10/10) yields a True result. Then we may say that a(10) = 5 specifically because 5 was the least k0.
		

Crossrefs

Programs

  • Mathematica
    j = 4;
    Nmax = 250;
    Array[val, Nmax];
    Do[val[i] = 0, {i, 1, Nmax}];
    Do[flag = 0;
      Do[If[(flag == 0 &&
          Prime[j]^IntegerExponent[n, Prime[j]] ==
           n/LCM[Table[
               If[Divisible[k, Prime[j]], 1,
                Denominator[(1/n) Binomial[n, k]]], {k, 1, k}] /.
              List -> Sequence]), val[n] = k; flag = 1; , Continue], {k, 1,
         n, 1}], {n, 1, Nmax}];
    tabseq = Table[val[i], {i, 1, Nmax}];
    (* alternate code *)
    a[n_] := Module[{k = 1, v = IntegerExponent[n, 7]}, While[Log[7, n/LCM @@ Denominator[Binomial[n, Select[Range[k], ! Divisible[#, 7] &]]/n]] != v, k++]; k]; Array[a, 100] (* Amiram Eldar, Apr 23 2021 *)
  • PARI
    Lp(k, n, p) = {my(list = List()); for (i=1, k, if (i%p, listput(list, binomial(n, i)/n)); ); lcm(apply(denominator, Vec(list))); }
    isok(k, n, v, p) = p^v == n/Lp(k, n, p);
    a(n, p=7) = {my(k=1, v=valuation(n, p)); for (k=1, n, if (isok(k, n, v, p), return(k)); ); n; } \\ Michel Marcus, Apr 22 2021

A343253 a(n) is the least k0 <= n such that v_11(n), the 11-adic order of n, can be obtained by the formula: v_11(n) = log_11(n / L_11(k0, n)), where L_11(k0, n) is the lowest common denominator of the elements of the set S_11(k0, n) = {(1/n)*binomial(n, k), with 0 < k <= k0 such that k is not divisible by 11} or 0 if no such k0 exists.

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 1, 4, 13, 7, 5, 16, 17, 9, 19, 5, 7, 2, 23, 8, 25, 13, 27, 7, 29, 5, 31, 32, 3, 17, 7, 9, 37, 19, 13, 8, 41, 7, 43, 4, 9, 23, 47, 16, 49, 25, 17, 13, 53, 27, 5, 8, 19, 29, 59, 5, 61, 31, 9, 64, 13, 3, 67, 17, 23, 7, 71, 9, 73, 37, 25, 19, 7, 13, 79, 16
Offset: 1

Views

Author

Dario T. de Castro, May 31 2021

Keywords

Comments

Conjecture: a(n) is the greatest power of a prime different from 11 that divides n.

Examples

			For n = 12, a(12) = 4. To understand this result, consider the largest set S_11, which is the S_11(k0=12, 12). According to the definition, S_11(n, n) is the set of elements of the form (1/n)*binomial(n, k), where k goes from 1 to n, skipping the multiples of 11. The elements of S_11(12, 12) are {1, 11/2, 55/3, 165/4, 66, 77, 66, 165/4, 55/3, 11/2, 0, 1/12}, where the zero was inserted pedagogically to identify the skipped term, i.e., when k is divisible by 11. At this point we verify which of the nested subsets {1}, {1, 11/2}, {1, 11/2, 55/3}, {1, 11/2, 55/3, 165/4}, ... will match for the first time the p-adic order's formula. If k varies from 1 to 4 (instead of 12) we see that the lowest common denominator of the set S_11(4, 12) will be 12. So, L_11(4, 12) = 12 and the equation v_11(12) = log_11(12/12) yields a True result. Then we may say that a(12) = 4 specifically because 4 was the least k0.
		

Crossrefs

Programs

  • Mathematica
    j = 5;
    Nmax = 250;
    Array[val, Nmax];
    Do[val[i] = 0, {i, 1, Nmax}];
    Do[flag = 0;
      Do[If[(flag == 0 &&
          Prime[j]^IntegerExponent[n, Prime[j]] ==
           n/LCM[Table[
               If[Divisible[k, Prime[j]], 1,
                Denominator[(1/n) Binomial[n, k]]], {k, 1, k}] /.
              List -> Sequence]), val[n] = k; flag = 1; , Continue], {k, 1,
         n, 1}], {n, 1, Nmax}];
    tabseq = Table[val[i], {i, 1, Nmax}];
    (* alternate code *)
    a[n_] := Module[{k = 1, v = IntegerExponent[n, 11]}, While[Log[11, n/LCM @@ Denominator[Binomial[n, Select[Range[k], ! Divisible[#, 11] &]]/n]] != v, k++]; k]; Array[a, 100] (* Amiram Eldar, Apr 23 2021 *)
  • PARI
    Lp(k, n, p) = {my(list = List()); for (i=1, k, if (i%p, listput(list, binomial(n, i)/n)); ); lcm(apply(denominator, Vec(list))); }
    isok(k, n, v, p) = p^v == n/Lp(k, n, p);
    a(n, p=11) = {my(k=1, v=valuation(n, p)); for (k=1, n, if (isok(k, n, v, p), return(k)); ); n; } \\ Michel Marcus, Apr 22 2021

A377780 First differences of A000015 (smallest prime-power >= n).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 13 2024

Keywords

Crossrefs

First differences of A000015, restriction to primes A345531.
The opposite is A377782, restriction to primes A377781, differences of A065514.
For squarefree instead of prime-power see A067535, A112925, A112926, A120327.
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime-powers, differences A057820.
A024619 lists the non-prime-powers, differences A375735, seconds A376599.
A080101 counts prime-powers between primes (exclusive).
A361102 lists the non-powers of primes, differences A375708.
A366833 counts prime-powers between primes.

Programs

  • Mathematica
    Differences[Table[NestWhile[#+1&,n,!PrimePowerQ[#]&],{n,100}]]
Showing 1-10 of 12 results. Next