A077200 Erroneous version of A085072.
0, 1, 2, 5, 2, 4, 4, 23, 16, 4, 2, 6, 4, 1, 6, 65, 2, 2, 4, 8, 1, 4, 6, 16, 24, 7, 98, 16, 2, 12, 6, 211, 1, 1, 3, 64, 4, 1, 7
Offset: 1
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.
sig[n_] := Sort @ FactorInteger[n][[;; , 2]]; a[1] = 1; a[n_] := Module[{sign = sig[n], k = n + 1}, While[sig[k] != sign, k++]; k]; Array[a, 70] (* Amiram Eldar, Dec 26 2020 *)
a(n) = {if (n==1, 1, my(k=1, s = vecsort(factor(n)[,2]~)); while (vecsort(factor(n+k)[,2]~) != s, k++); n+k;)} \\ Michel Marcus, Nov 02 2020
a(7) = 14 as 14 and 14+7 = 21 have the same prime signature p*q. a(13) = 21 as 21 is the smallest number such that 21 +13 = 34 and 21 both have the same prime signature p*q. a(19) = 8 as 8 +19 = 27 = 3^3,8 = 2^3 both have the prime signature p^3.
ps(n) = local(f); f = factor(n); vecsort(f[,2]); a(n) = local(P, m, v); P = vector(n, i, ps(i)); m = 1; while (1, for (i = 1, n, v = ps(m*n + i); if (v == P[i], return((m - 1)*n + i), P[i] = v)); m++); \\ David Wasserman, Mar 09 2005
a(6) = 379 as 6*379 = 2*3*379 and 6+379 = 385 = 5*7*11 both have prime signature p*q*r.
s:= proc(n) s(n):= sort(map(i-> i[2], ifactors(n)[2])) end: a:= proc(n) option remember; local k; for k while s(n*k)<>s(n+k) do od; k end: seq(a(n), n=1..70); # Alois P. Heinz, Mar 06 2019
kmax = 10^6; s[n_] := FactorInteger[n][[All, 2]] // Sort; a[n_] := Module[{k}, If[n == 1, Return[2]]; For[k = 1, k <= kmax, k++, If[s[n k] == s[n+k], Return[k]]]; 0]; Array[a, 70] (* Jean-François Alcover, Nov 17 2020 *)
sgntr(n) = vecsort(factor(n)[, 2]~); a(n) = {my(k=1); while (sgntr(n+k) != sgntr(n*k), k++); k; } \\ Michel Marcus, Nov 17 2020
a(12) = 63 as 12 + 63 = 75, 2^2*3 + 3^2*7 = 5^2*3, all have the prime signature p^2*q. a(1) = 0, because the only possible value for k is then 1, giving n+k=2, with a different signature. a(2) = 3, because 2, 3 and 2+3=5 have the same prime signature. a(36) = 0, because if a(n) exists then k exists such that k^2 + 36 = m^2 where k^2, 36 and m^2 have the same prime signature. Rewriting 36 = m^2 - k^2 = (m - k)*(m + k) and then inspection over divisors of 36 gives no terms. Alternatively checking Pythagorean triples gives the same result. - _David A. Corneth_, Mar 08 2019
a[n_?PrimeQ] := If[PrimeQ[n + 2], 2, 0]; a[2] = 3; a[36] = 0; ps[n_] := Sort[ FactorInteger[n][[;; , 2]] ]; a[n_] := Module[{k = 2, f = FactorInteger[n]}, ps0 = Sort[f[[;; , 2]]]; If[Length[f] == 1, 0, While[ps[k] != ps0 || ps[n + k] != ps0, k++]; k]]; Array[a, 71] (* Amiram Eldar, Mar 07 2019 works for n <= 71 *)
sigt(n) = vecsort(factor(n)[,2]~); a(n) = { if ((n==1) || (isprimepower(n) && !isprime(n)), return(0)); if (isprimepower(n) && !isprime(n), return(0)); if ((n!=2) && isprime(n), if (isprime(n+2), return(2), return(0))); if (n==36, return(0)); my(k=2, v = sigt(n)); while ((sigt(k) != v) || (sigt(n+k) != v), k++); k; } \\ Michel Marcus, Mar 07 2019; works for n <= 71
Comments