A005867
a(0) = 1; for n > 0, a(n) = (prime(n)-1)*a(n-1).
Original entry on oeis.org
1, 1, 2, 8, 48, 480, 5760, 92160, 1658880, 36495360, 1021870080, 30656102400, 1103619686400, 44144787456000, 1854081073152000, 85287729364992000, 4434961926979584000, 257227791764815872000, 15433667505888952320000
Offset: 0
a(3): the mod 30 prime remainder set sieve representation yields the remainder set: {1, 7, 11, 13, 17, 19, 23, 29}, 8 elements.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- T. D. Noe, Table of n, a(n) for n = 0..99
- Larry Deering, The Black Key Sieve, Box 275, Bellport NY 11713-0275, 1998.
- Alphonse de Polignac, Six propositions arithmologiques déduites du crible d'Ératosthène, Nouvelles annales de mathématiques : journal des candidats aux écoles polytechnique et normale, Série 1, Tome 8 (1849), pp. 423-429. See p. 425.
- Frank Ellermann, Illustration for A002110, A005867, A038110, A060753.
- Ken Hicks and Kevin Ward, Series and Product Relations Made from Primes, arXiv:2108.03268 [math.NT], 2021.
- Dennis Martin, Proofs Regarding Primorial Patterns [via Internet Archive Wayback-machine]
- Dennis Martin, Proofs Regarding Primorial Patterns [Cached copy, with permission of the author]
- Francis E. Masat, Letter to N. J. A. Sloane with attachment: "A note on prime number sequences" (unpublished manuscript), Apr. 1991.
- Travis Near, Improving MATLAB's isprime performance without arbitrary-precision arithmetic, arXiv:2108.04791 [cs.MS], 2021.
- John K. Sellers, Distribution of twin primes in repeating sequences of prime factors, arXiv:2108.00288 [math.GM], 2021. See Table 1 p. 11.
- Andrew V. Sutherland, Order Computations in Generic Groups, Ph. D. Dissertation, Math. Dept., M.I.T., 2007.
-
a005867 n = a005867_list !! n
a005867_list = scanl (*) 1 a006093_list
-- Reinhard Zumkeller, May 01 2013
-
A005867 := proc(n)
mul(ithprime(j)-1,j=1..n) ;
end proc: # Zerinvary Lajos, Aug 24 2008, R. J. Mathar, May 03 2017
-
Table[ Product[ EulerPhi[ Prime[ j ] ], {j, 1, n} ], {n, 1, 20} ]
RecurrenceTable[{a[0]==1,a[n]==(Prime[n]-1)a[n-1]},a,{n,20}] (* Harvey P. Dale, Dec 09 2013 *)
EulerPhi@ FoldList[Times, 1, Prime@ Range@ 18] (* Michael De Vlieger, Mar 18 2016 *)
-
for(n=0, 22, print1(prod(k=1,n, prime(k)-1), ", "))
Offset changed to 0, Name changed, and Comments and Examples sections edited by
T. D. Noe, Apr 04 2010
A219428
a(n) = n - 1 - phi(n).
Original entry on oeis.org
-1, 0, 0, 1, 0, 3, 0, 3, 2, 5, 0, 7, 0, 7, 6, 7, 0, 11, 0, 11, 8, 11, 0, 15, 4, 13, 8, 15, 0, 21, 0, 15, 12, 17, 10, 23, 0, 19, 14, 23, 0, 29, 0, 23, 20, 23, 0, 31, 6, 29, 18, 27, 0, 35, 14, 31, 20, 29, 0, 43, 0, 31, 26, 31, 16, 45, 0, 35, 24, 45, 0, 47
Offset: 1
-
[(n - 1 - (EulerPhi(n))): n in [1..100]]; // Vincenzo Librandi, Jan 26 2013
-
Table[n - (EulerPhi[n] + 1), {n, 75}] (* Alonso del Arte, Nov 17 2012 *)
-
for(n=1,100,print1(n-1-eulerphi(n)","))
A185670
Number of pairs (x,y) with 1 <= x < y <= n with at least one common factor.
Original entry on oeis.org
0, 0, 0, 1, 1, 4, 4, 7, 9, 14, 14, 21, 21, 28, 34, 41, 41, 52, 52, 63, 71, 82, 82, 97, 101, 114, 122, 137, 137, 158, 158, 173, 185, 202, 212, 235, 235, 254, 268, 291, 291, 320, 320, 343, 363, 386, 386, 417, 423, 452, 470, 497, 497, 532, 546, 577, 597, 626, 626, 669, 669, 700, 726, 757, 773, 818, 818, 853, 877, 922, 922, 969, 969, 1006, 1040
Offset: 1
For n=9, the a(9)=9 pairs are {(2,4),(2,6),(2,8),(3,6),(3,9),(4,6),(4,8),(6,8),(6,9)}.
-
a185670 n = length [(x,y) | x <- [1..n-1], y <- [x+1..n], gcd x y > 1]
-- Reinhard Zumkeller, Mar 02 2012
-
with(numtheory): A185670:=n->n*(n-1)/2 + 1 - add( phi(i), i=1..n): seq(A185670(n), n=1..100); # Wesley Ivan Hurt, Jan 30 2017
-
1 + Accumulate[ Table[n - EulerPhi[n] - 1, {n, 1, 75}]] (* Jean-François Alcover, Jan 04 2013 *)
-
a185670(n) = sum(i=2, n, sum(j=2, i-1, gcd(i,j)>1)) \\ Hugo Pfoertner, Sep 04 2024
-
from functools import lru_cache
@lru_cache(maxsize=None)
def A185670(n): # based on second formula in A018805
if n == 0:
return 0
c, j = 2, 2
k1 = n//j
while k1 > 1:
j2 = n//k1 + 1
c += (j2-j)*(k1*(k1-1)+1-2*A185670(k1))
j, k1 = j2, n//j2
return (c-j)//2 # Chai Wah Wu, Mar 24 2021
A219839
a(n) is the number of odd integers in 2..(n-1) that have a common factor (other than 1) with n.
Original entry on oeis.org
0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 2, 0, 1, 3, 0, 0, 3, 0, 2, 4, 1, 0, 4, 2, 1, 4, 2, 0, 7, 0, 0, 6, 1, 5, 6, 0, 1, 7, 4, 0, 9, 0, 2, 10, 1, 0, 8, 3, 5, 9, 2, 0, 9, 7, 4, 10, 1, 0, 14, 0, 1, 13, 0, 8, 13, 0, 2, 12, 11, 0, 12, 0, 1, 17, 2, 8, 15, 0, 8, 13, 1, 0, 18
Offset: 1
n=1: there is no odd number greater than 2 but smaller than 1-1=0, so a(1)=0.
Same for n=2,3.
n=4: 3 is the only odd number in 2..(4-1), and GCD(3,4)=1, so a(4)=0.
For any prime numbers and numbers in the form of 2^n, no odd number in 2..(n-1) has common factor with n, so a(p)=0 and a(2^n)=0, n>0.
n=6: 3,5 are odd numbers in 2..(6-1), and GCD(3,6)=3>1 and GCD(5,6)=1, so a(6)=1.
n=15: candidates are 3,5,7,9,11,13. 3, 5, and 9 have greater than 1 common factors with 15, so a(15)=3
From _Wolfdieter Lang_, Sep 23 2013: (Start)
Example n = 15 for a(n) = floor(n/2) - delta(n): 1, 3, 5, 7, 9, 11, 13 take out 1, 7, 9, 11, leaving 3, 5, 13. Therefore, a(15) = 7 - 4 = 3. See the formula above for delta.
In the regular 15-gon the 3 (= a(15)) diagonal/side ratios R(15, 5), R(15, 6) and R(15,7) can be expressed as linear combinations of the R(15,j), j=1..4. See the n-gon comment above. (End)
From _Wolfdieter Lang_, Nov 23 2020: (Start)
n = 1: RS(1) = {0}, RRS(1) = {1}, hence a(1) = 0 - 1 = 0. Here RRS(1) is not {0}(standard) because delta(1) := 1 (the degree of minimal polynomial for 2*cos(Pi//1) = -2 which is x+2, see A187360).
n = 6: RS(6) = {0, 1, 2, 3, 4, 5} and RRS(6) = {1,5}, hence a(6) = 3 - 2 = 1, and A111774(1) = 6 = A337940(1, 1).
a(15) = 7 - 4 = 3, and A111774(6) = 15 = A337940(3, 3) = A337940(4, 1) (multiplicity 2 = A338428(6)). (End)
-
Table[Count[Range[3, n - 1, 2], ?(GCD[n, #] > 1 &)], {n, 100}] (* _T. D. Noe, Nov 30 2012 *)
a[1] = 0; a[n_] := Floor[n/2] - EulerPhi[2*n]/2; Array[a, 80] (* Amiram Eldar, Nov 28 2020 *)
-
a(n) = sum(i=2, n-1, (i%2) && (gcd(i,n)!=1)); \\ Michel Marcus, Aug 07 2018
A290599
Number of numbers from 1 to A002808(n) - 1 that are non-coprime to A002808(n).
Original entry on oeis.org
1, 3, 3, 2, 5, 7, 7, 6, 7, 11, 11, 8, 11, 15, 4, 13, 8, 15, 21, 15, 12, 17, 10, 23, 19, 14, 23, 29, 23, 20, 23, 31, 6, 29, 18, 27, 35, 14, 31, 20, 29, 43, 31, 26, 31, 16, 45, 35, 24, 45, 47, 37, 34, 39, 16, 53, 47, 26, 41, 59, 20, 43, 30, 47, 65, 18, 47, 32, 47, 22, 63, 55, 38, 59
Offset: 1
a(4) = 2 because A002808(4) = 9, with the two non-coprime positive numbers smaller than 9, namely 3 and 6. See row n = 4 of A290600.
A308473
Sum of numbers < n which have common prime factors with n.
Original entry on oeis.org
0, 0, 0, 2, 0, 9, 0, 12, 9, 25, 0, 42, 0, 49, 45, 56, 0, 99, 0, 110, 84, 121, 0, 180, 50, 169, 108, 210, 0, 315, 0, 240, 198, 289, 175, 414, 0, 361, 273, 460, 0, 609, 0, 506, 450, 529, 0, 744, 147, 725, 459, 702, 0, 945, 385, 868, 570, 841, 0, 1290, 0, 961, 819, 992, 520
Offset: 1
Cf.
A000010,
A000217,
A001065,
A008578,
A008683,
A016035,
A023896,
A024816,
A051953,
A067392,
A109607.
-
nmax = 65; CoefficientList[Series[-x^2 (2 - x)/(1 - x)^2 - Sum[MoebiusMu[k] k x^k/(1 - x^k)^3, {k, 2, nmax}], {x, 0, nmax}], x] // Rest
a[n_] := Sum[If[GCD[n, k] > 1, k, 0], {k, 1, n - 1}]; Table[a[n], {n, 1, 65}]
Join[{0}, Table[n (n - EulerPhi[n] - 1)/2, {n, 2, 65}]]
-
a(n) = sum(k=1, n-1, if (gcd(n,k)>1, k)); \\ Michel Marcus, May 31 2019
-
from sympy import totient
def A308473(n): return n*(n-totient(n)-1)>>1 if n>1 else 0 # Chai Wah Wu, Nov 06 2023
A364934
a(n+1) = 1 + number of previous terms that share a factor > 1 with a(n); a(1) = 2.
Original entry on oeis.org
2, 2, 3, 2, 4, 5, 2, 6, 8, 8, 9, 4, 10, 12, 14, 13, 2, 14, 15, 8, 16, 17, 2, 18, 22, 20, 23, 2, 22, 23, 3, 8, 24, 29, 2, 26, 28, 28, 29, 3, 10, 32, 31, 2, 32, 33, 13, 4, 34, 36, 42, 43, 2, 38, 39, 17, 4, 40, 43, 3, 15, 21, 21, 22, 43, 4, 43, 5, 9, 19, 3, 20, 48, 58, 48, 60, 63, 28, 52, 53, 2, 51, 28
Offset: 1
[2,*] 1 term shares a factor with 2, so a(2) = 1+1 = 2.
[2,2,*] 2 terms share a factor with 2, so a(3) = 1+2 = 3.
[2,2,3,*] 1 term shares a factor with 3, so a(4) = 1+1 = 2.
[2,2,3,2,*] 3 terms share a factor with 2, so a(5) = 1+3 = 4.
[2,2,3,2,4,*] 4 terms share a factor with 4, so a(6) = 1+4 = 5.
-
nn = 120; c[] := 0; s = {}; a[1] = j = 2; Do[c[j]++; If[c[j] == 1, AppendTo[s, j]]; k = 1 + Total@ Map[c[#] Boole[GCD[#, j] > 1] &, s]; Set[{a[n], j}, {k, k}], {n, 2, nn}]; Array[a, nn] (* _Michael De Vlieger, Aug 16 2023 *)
-
from sympy.ntheory import primefactors
a=[2]; p = [{2}];
for n in range(1,1000):
a.append(sum(1 if p[-1].intersection(p[i]) else 0 for i in range(n))+1)
p.append(set(primefactors(a[-1])))
-
from math import gcd, prod
from sympy import factorint
from itertools import islice
from collections import Counter
def agen(): # generator of terms
a=[2]; f=2; c=Counter([f])
while True:
yield a[-1]
a.append(1 + sum(c[fi] for fi in c if gcd(f,fi)>1))
f=prod(factorint(a[-1]).keys())
c[f] += 1
a=list(islice(agen(), 1000)) # Michael S. Branicky, Aug 16 2023
A366192
Pairs (i, j) of noncoprime positive integers sorted first by i + j then by i.
Original entry on oeis.org
2, 2, 2, 4, 3, 3, 4, 2, 2, 6, 4, 4, 6, 2, 3, 6, 6, 3, 2, 8, 4, 6, 5, 5, 6, 4, 8, 2, 2, 10, 3, 9, 4, 8, 6, 6, 8, 4, 9, 3, 10, 2, 2, 12, 4, 10, 6, 8, 7, 7, 8, 6, 10, 4, 12, 2, 3, 12, 5, 10, 6, 9, 9, 6, 10, 5, 12, 3, 2, 14, 4, 12, 6, 10, 8, 8, 10, 6, 12, 4, 14, 2
Offset: 1
The first few pairs are, seen as an irregular triangle (where rows with a prime index are empty (and are therefore missing)):
[2, 2],
[2, 4], [3, 3], [4, 2],
[2, 6], [4, 4], [6, 2],
[3, 6], [6, 3],
[2, 8], [4, 6], [5, 5], [6, 4], [ 8, 2],
[2, 10], [3, 9], [4, 8], [6, 6], [ 8, 4], [ 9, 3], [10, 2],
[2, 12], [4, 10], [6, 8], [7, 7], [ 8, 6], [10, 4], [12, 2],
[3, 12], [5, 10], [6, 9], [9, 6], [10, 5], [12, 3],
...
There are A016035(n) pairs in row n.
-
aList := proc(upto) local F, P, n, t, count;
P := NULL; count := 0:
for n from 2 while count < upto do
F := select(t -> igcd(t, n - t) <> 1, [$1..n-1]);
P := P, seq([t, n - t], t = F);
count := count + nops([F]) od:
ListTools:-Flatten([P]) end:
aList(16);
-
A366192row[n_]:=Select[Array[{#,n-#}&,n-1],!CoprimeQ[First[#],Last[#]]&];
Array[A366192row,20,2] (* Paolo Xausa, Nov 28 2023 *)
-
from math import gcd
from itertools import chain, count, islice
def A366192_gen(): # generator of terms
return chain.from_iterable((i,n-i) for n in count(2) for i in range(1,n) if gcd(i,n-i)>1)
A366192_list = list(islice(A366192_gen(),30)) # Chai Wah Wu, Oct 10 2023
Showing 1-8 of 8 results.
Comments