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

A322357 a(n) = A322354(n) / A322356(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 16 2018

Keywords

Programs

  • Mathematica
    f[n_] := If[n == 1, 1, Times @@ Power @@@ ({#[[1]] + 2, #[[2]]} & /@ FactorInteger [n])]; rad[n_] := Times @@ (First@# & /@ FactorInteger@n); fun[p_, n_] := If[ PrimeQ[p + 2] && Divisible[n, p + 2], p + 2, 1]; a[n_] := GCD[rad[n], f[rad[n]]]/ Times @@ (fun[#, n] & /@ FactorInteger[n][[;; , 1]]); Array[a, 120] (* Amiram Eldar, Dec 16 2018 *)
  • PARI
    A166590(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1] += 2); factorback(f); };
    A322362(n) = gcd(n, A166590(n));
    A007947(n) = factorback(factorint(n)[, 1]);
    A322354(n) = A322362(A007947(n));
    A322356(n) = { my(f = factor(n), m=1); for(i=1, #f~, if(isprime(f[i,1]+2)&&!(n%(f[i,1]+2)), m *= (f[i,1]+2))); (m); };
    A322357(n) = (A322354(n)/A322356(n));

Formula

a(n) = A322354(n) / A322356(n).

A329346 a(n) = A322356(A324886(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 5, 7, 1, 1, 1, 1, 1, 1, 5, 1, 7, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 7, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 7, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 19, 1, 1, 1, 1, 13, 1, 7, 1, 1, 13, 1, 1, 1, 1, 1, 7, 1, 1, 13, 1, 1, 1, 1, 1, 1, 19, 1, 1, 1, 1, 7, 1, 13, 1, 13, 1, 1, 1, 1, 13
Offset: 1

Views

Author

Antti Karttunen, Nov 11 2019

Keywords

Examples

			For n = 128 = 2^7, A108951(128) = A034386(2)^7 = 128. As 128 = 4 * 30 + 1*6 + 1* 2, A276086(128) = 36015 = 7^4 * 5^1 * 3^1, and there are two such primes that both p and p-2 divide n, and p-2 is also prime, namely, 7 and 5, thus a(128) = 7*5 = 35. This is also the first occurrence of composite number in this sequence.
		

Crossrefs

Programs

  • PARI
    A034386(n) = prod(i=1, primepi(n), prime(i));
    A108951(n) = { my(f=factor(n)); prod(i=1, #f~, A034386(f[i, 1])^f[i, 2]) };  \\ From A108951
    A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); };
    A324886(n) = A276086(A108951(n));
    A322356(n) = { my(f = factor(n), m=1); for(i=1, #f~, if(isprime(f[i,1]+2)&&!(n%(f[i,1]+2)), m *= (f[i,1]+2))); (m); };
    A329346(n) = A322356(A324886(n));

Formula

a(n) = A322356(A324886(n)).

A322358 Number of distinct twin prime pairs p, p+2 such that both of them divide n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 16 2018

Keywords

Examples

			For n = 45 = 3^2 * 5, there exists one twin prime pair (3,5) whose both members divide 45, thus a(45) = 1.
For n = 105 = 3 * 5 * 7, there exists two twin prime pairs, (3,5) and (5,7) whose both members divide 105, thus a(105) = 2.
		

Crossrefs

Programs

  • Mathematica
    f[p_, n_] := If[PrimeQ[p + 2] && Divisible[n, p*(p + 2)], 1, 0]; a[n_] := Plus @@ (f[#, n] & /@ FactorInteger[n][[;; , 1]]); Array[a, 105] (* Amiram Eldar, Dec 16 2018 *)
  • PARI
    A322358(n) = { my(ps=factor(n)[,1]~); sum(i=1,#ps,isprime(ps[i]+2)*!(n%(ps[i]+2))); };

Formula

a(n) = A001221(A322356(n)) = A001222(A322356(n)).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A209328 = 0.107983... . - Amiram Eldar, Jan 01 2024

A322354 Greatest common divisor of product p and product (p+2), where p ranges over distinct prime divisors of n; a(n) = gcd(A007947(n), A166590(A007947(n))).

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 10, 1, 2, 1, 2, 7, 2, 1, 2, 3, 2, 1, 6, 1, 2, 5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 10, 1, 2, 3, 2, 5, 2, 1, 2, 1, 14, 1, 2, 1, 2, 5, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 10, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 105
Offset: 1

Views

Author

Antti Karttunen, Dec 16 2018

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := If[n == 1, 1, Times @@ Power @@@ ({#[[1]] + 2, #[[2]]} & /@ FactorInteger[n])]; rad[n_] := Times @@ (First@# & /@ FactorInteger@n); a[n_] := GCD[rad[n], f[rad[n]]]; Array[a, 120] (* Amiram Eldar, Dec 16 2018 *)
  • PARI
    A166590(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1] += 2); factorback(f); };
    A322362(n) = gcd(n, A166590(n));
    A007947(n) = factorback(factorint(n)[, 1]);
    A322354(n) = A322362(A007947(n));
    \\ Alternatively as:
    A322354(n) = gcd(A007947(n), A166590(A007947(n)));

Formula

a(n) = A322362(A007947(n)) = gcd(A007947(n), A166590(A007947(n))).
a(n) = A322356(n) * A322357(n).

A323082 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = -(n mod 2) if n is a prime, and f(n) = A300840(n) for any other number.

Original entry on oeis.org

1, 2, 3, 4, 3, 5, 3, 4, 6, 7, 3, 8, 3, 9, 10, 11, 3, 6, 3, 12, 13, 14, 3, 8, 15, 16, 17, 18, 3, 10, 3, 11, 19, 20, 21, 22, 3, 23, 24, 12, 3, 13, 3, 25, 26, 27, 3, 28, 29, 15, 30, 31, 3, 17, 32, 18, 33, 34, 3, 35, 3, 36, 37, 38, 39, 19, 3, 40, 41, 21, 3, 22, 3, 42, 43, 44, 45, 24, 3, 46, 47, 48, 3, 49, 50, 51, 52, 25, 3, 26, 53, 54, 55, 56, 57, 28, 3, 29, 58, 59, 3, 30, 3, 31
Offset: 1

Views

Author

Antti Karttunen, Jan 04 2019

Keywords

Comments

For all i, j: A323074(i) = A323074(j) => a(i) = a(j).
Like the related A322822 also this filter sequence satisfies the following two implications, for all i, j >= 1:
a(i) = a(j) => A322356(i) = A322356(j),
a(i) = a(j) => A290105(i) = A290105(j).

Crossrefs

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    ispow2(n) = (n && !bitand(n,n-1));
    A302777(n) = ispow2(isprimepower(n));
    A050376list(up_to) = { my(v=vector(up_to), i=0); for(n=1,oo,if(A302777(n), i++; v[i] = n); if(i == up_to,return(v))); };
    v050376 = A050376list(up_to);
    A050376(n) = v050376[n];
    A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
    A052331(n) = { my(s=0,e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&A302777(n/d), e = vecsearch(v050376, n/d); if(!e, print("v050376 too short!"); return(1/0)); s += 2^(e-1); n = d; break))); (s); };
    A300840(n) = A052330(A052331(n)>>1);
    A323082aux(n) = if(isprime(n),-(n%2),A300840(n));
    v323082 = rgs_transform(vector(up_to,n,A323082aux(n)));
    A323082(n) = v323082[n];

A322702 a(n) is the product of primes p such that p+1 divides n.

Original entry on oeis.org

1, 1, 2, 3, 1, 10, 1, 21, 2, 1, 1, 330, 1, 13, 2, 21, 1, 170, 1, 57, 2, 1, 1, 53130, 1, 1, 2, 39, 1, 290, 1, 651, 2, 1, 1, 5610, 1, 37, 2, 399, 1, 5330, 1, 129, 2, 1, 1, 2497110, 1, 1, 2, 3, 1, 9010, 1, 273, 2, 1, 1, 10727970, 1, 61, 2, 651, 1, 10, 1, 201, 2
Offset: 1

Views

Author

Daniel Suteu, Dec 23 2018

Keywords

Comments

In general, a(n) is the product of A072627(n) distinct prime factors, with a(n) = 1 iff A072627(n) = 0.

Examples

			For n=12, the divisors of 12 are {1, 2, 3, 4, 6, 12}. The prime numbers p, such that p+1 is a divisor of 12, are {2, 3, 5, 11}, therefore a(12) = 2 * 3 * 5 * 11 = 330.
		

Crossrefs

Programs

  • Maple
    a:= n-> mul(`if`(isprime(d-1), d-1, 1), d=numtheory[divisors](n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Dec 29 2018
  • Mathematica
    Array[Apply[Times, Select[Divisors@ #, PrimeQ[# - 1] &] - 1 /. {} -> {1}] &, 69] (* Michael De Vlieger, Jan 07 2019 *)
  • PARI
    a(n) = my(d=divisors(n)); prod(k=1, #d, if(isprime(d[k]-1), d[k]-1, 1));

Formula

a(n) = Product_{p prime, p+1 divides n} p.
a(n) = denominator of Sum_{p prime, p+1 divides n} 1/p.
a(n) = Product_{d|n, d-1 is prime} (d-1), where d runs over the divisors of n.
a(2*n + 1) = 2, iff n == 1 (mod 3), else a(2*n + 1) = 1.
A001221(a(n)) = A072627(n). - Antti Karttunen, Jan 12 2019
Showing 1-6 of 6 results.