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.

A206369 a(p^k) = p^k - p^(k-1) + p^(k-2) - ... +- 1, and then extend by multiplicativity.

Original entry on oeis.org

1, 1, 2, 3, 4, 2, 6, 5, 7, 4, 10, 6, 12, 6, 8, 11, 16, 7, 18, 12, 12, 10, 22, 10, 21, 12, 20, 18, 28, 8, 30, 21, 20, 16, 24, 21, 36, 18, 24, 20, 40, 12, 42, 30, 28, 22, 46, 22, 43, 21, 32, 36, 52, 20, 40, 30, 36, 28, 58, 24, 60, 30, 42, 43, 48, 20, 66, 48, 44, 24, 70, 35
Offset: 1

Views

Author

N. J. A. Sloane, Feb 06 2012

Keywords

Comments

For more information see the Comments in A061020.
a(n) is the number of integers j such that 1 <= j <= n and gcd(n,j) is a perfect square. For example, a(12) = 6 because |{1,4,5,7,8,11}|=6 and the respective GCDs with 12 are 1,4,1,1,4,1, which are squares. - Geoffrey Critzer, Feb 16 2015
If m is squarefree (A005117), then a(m) = A000010(m) where A000010 is the Euler totient function. - Michel Marcus, Nov 08 2017
Also it appears that the primorials (A002110) is the sequence of indices of minimum records for a(n)/n, and these records are A038110(n)/A060753(n). - Michel Marcus, Nov 09 2017
Also called rho(n). When rho(n) | n, then n is called k-imperfect, with k = n/rho(n), cf. A127724. - M. F. Hasler, Feb 13 2020

References

  • P. J. McCarthy, Introduction to Arithmetical Functions, Springer Verlag, 1986, page 25.

Crossrefs

Cf. A027748 row, A124010, A206475 (first differences).
Cf. A078429.
Cf. A127724 (k-imperfect), A127725 (2-imperfect), A127726 (3-imperfect).

Programs

  • Haskell
    a206369 n = product $
       zipWith h (a027748_row n) (map toInteger $ a124010_row n) where
               h p e = sum $ take (fromInteger e + 1) $
                             iterate ((* p) . negate) (1 - 2 * (e `mod` 2))
    -- Reinhard Zumkeller, Feb 08 2012
    
  • Maple
    a:= n-> mul(add(i[1]^(i[2]-j)*(-1)^j, j=0..i[2]), i=ifactors(n)[2]):
    seq(a(n), n=1..100);  # Alois P. Heinz, Nov 03 2017
  • Mathematica
    Table[Length[Select[Range[n], IntegerQ[GCD[n, #]^(1/2)] &]], {n, 72}] (* Geoffrey Critzer, Feb 16 2015 *)
    a[n_] := n*DivisorSum[n, LiouvilleLambda[#]/#&]; Array[a, 72] (* Jean-François Alcover, Dec 04 2017, after Enrique Pérez Herrero *)
    f[p_,e_] := Sum[(-1)^(e-k)*p^k, {k,0,e}]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Jan 01 2020 *)
  • PARI
    a(n) = sum(k=1, n, issquare(gcd(n, k)));
    
  • PARI
    ak(p,e)=my(s=1); for(i=1,e, s=s*p + (-1)^i); s
    a(n)=my(f=factor(n)); prod(i=1,#f~, ak(f[i,1],f[i,2])) \\ Charles R Greathouse IV, Dec 27 2016
    
  • PARI
    a(n) = sumdiv(n, d, eulerphi(n/d) * issquare(d)); \\ Daniel Suteu, Jun 27 2018
    
  • PARI
    apply( {A206369(n)=vecprod([f[1]^(f[2]+1)\/(f[1]+1)|f<-factor(n)~])}, [1..99]) \\ M. F. Hasler, Feb 13 2020
    
  • Python
    from math import prod
    from sympy import factorint
    def A206369(n): return prod((lambda x:x[0]+int((x[1]<<1)>=p+1))(divmod(p**(e+1),p+1)) for p, e in factorint(n).items()) # Chai Wah Wu, Mar 05 2024

Formula

a(n) = abs(A061020(n)).
a(n) = n*Sum_{d|n} lambda(d)/d, where lambda(n) is A008836(n). - Enrique Pérez Herrero, Sep 23 2012
Dirichlet g.f.: zeta(s - 1)*zeta(2*s)/zeta(s). - Geoffrey Critzer, Feb 25 2015
From Michel Marcus, Nov 05 2017: (Start)
a(2^n) = A001045(n+1);
a(3^n) = A015518(n+1);
a(5^n) = A015531(n+1);
a(7^n) = A015552(n+1);
a(11^n) = A015592(n+1). (End)
a(p^k) = p^k - a(p^(k - 1)) for k > 0 and prime p. - David A. Corneth, Nov 09 2017
a(n) = Sum_{d|n, d is a perfect square} phi(n/d), where phi(k) is the Euler totient function. - Daniel Suteu, Jun 27 2018
a(p^k) = A071324(p^k), for k >= 0 and prime p. - Michel Marcus, Aug 11 2018
Sum_{k=1..n} a(k) ~ Pi^2 * n^2 / 30. - Vaclav Kotesovec, Feb 07 2019
G.f.: Sum_{k>=1} lambda(k)*x^k/(1 - x^k)^2. - Ilya Gutkovskiy, May 23 2019
a(n) = Sum_{i=1..n} A010052(gcd(n,i)). - Ridouane Oudra, Nov 24 2019
a(p^k) = round(p^(k+1)/(p+1)). - M. F. Hasler, Feb 13 2020

A333261 Numbers k such that A071324(k) = A071324(k+1).

Original entry on oeis.org

1, 5, 51, 68, 87, 116, 171, 176, 591, 2108, 2403, 7143, 8787, 9308, 18548, 19371, 27387, 32127, 34887, 37928, 40131, 140667, 180548, 192428, 200996, 433311, 521727, 934449, 2476671, 2617563, 3960896, 8198156, 9670748, 11892512, 16585748, 19113651, 25367396, 25643012
Offset: 1

Views

Author

Amiram Eldar, Mar 13 2020

Keywords

Comments

From Shreyansh Jaiswal, Jun 14 2025: (Start)
If the density of the set containing all even terms exists, then it is less than 0.15. (Proposition 3 in Jaiswal.)
Let k denote any even term. Then, the least prime factor of k+1 is either 3 or 5. (Theorem 11 in Jaiswal.)
Each even term satisfies at least one of three specific congruences. (Theorem 2 in Jaiswal.)
10519952096 and 16159802432 are also terms of this sequence.
Conjecture: There are infinitely many terms of this sequence. (Conjecture 15 in Jaiswal.) (End)

Examples

			1 is a term since A071324(1) = A071324(2) = 1.
5 is a term since A071324(5) = A071324(6) = 4.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Plus @@ (-(d = Divisors[n])*(-1)^(Range[Length[d],1,-1])); seq = {}; f1 = f[1]; Do[f2 = f[n]; If[f1 == f2, AppendTo[seq, n-1]]; f1 = f2, {n, 2, 50000}]; seq
    SequencePosition[Table[Total[Times@@@Partition[Riffle[Reverse[Divisors[n]],{1,-1},{2,-1,2}],2]],{n,2565*10^4}],{x_,x_}][[All,1]] (* Harvey P. Dale, Nov 06 2022 *)
  • Python
    from sympy import divisors;  from functools import lru_cache
    cached_divisors = lru_cache()(divisors)
    def c(n):  return sum(d if i%2==0 else -d for i, d in enumerate(reversed(cached_divisors(n))))
    for n in range(1,2201):
        if c(n) == c(n+1):
            print(n, end=", ") # Shreyansh Jaiswal, Apr 14 2025

A206475 First differences of A206369.

Original entry on oeis.org

0, 1, 1, 1, -2, 4, -1, 2, -3, 6, -4, 6, -6, 2, 3, 5, -9, 11, -6, 0, -2, 12, -12, 11, -9, 8, -2, 10, -20, 22, -9, -1, -4, 8, -3, 15, -18, 6, -4, 20, -28, 30, -12, -2, -6, 24, -24, 21, -22, 11, 4, 16, -32, 20, -10, 6, -8, 30, -34, 36, -30, 12, 1, 5, -28, 46
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 08 2012

Keywords

Comments

a(A206368(n)) = 0.

Programs

  • Haskell
    a206475 n = a206475_list !! (n-1)
    a206475_list = zipWith (-) (tail a206369_list) a206369_list
  • Mathematica
    (* b = A206369 *) b[n_] := n*DivisorSum[n, LiouvilleLambda[#]/# &];
    Array[b, 100] // Differences (* Jean-François Alcover, Dec 04 2017 *)

Formula

a(n) = A206369(n+1) - A206369(n).

A348585 Numbers k such that A113184(k) = A113184(k+1).

Original entry on oeis.org

1, 8, 27, 375, 459, 620, 1652, 2871, 3451, 3956, 8055, 8636, 8907, 9844, 10647, 12104, 19491, 20155, 27089, 27643, 38180, 41547, 48364, 62379, 74875, 79304, 83780, 90692, 115289, 139460, 146828, 233729, 291819, 297987, 324423, 338547, 365660, 377540, 392635, 403575
Offset: 1

Views

Author

Amiram Eldar, Oct 24 2021

Keywords

Comments

Equivalently, numbers k such that A002129(k) = -A002129(k+1).

Examples

			1 is a term since A113184(1) = A113184(2) = 1.
8 is a term since A113184(8) = A113184(9) = 13.
		

Crossrefs

Similar sequences: A002961, A206368, A333261.

Programs

  • Mathematica
    f[p_, e_] := If[p == 2, 2^(e + 1)-3, (p^(e + 1) - 1)/(p - 1)]; s[1] = 1; s[n_] := Times @@ f @@@ FactorInteger[n]; Select[Range[10^5], s[#] == s[# + 1] &]
    f[n_]:=Module[{dn=Divisors[n],odn,edn},odn=Select[dn,OddQ];edn=Select[dn,EvenQ];Abs[Total[odn]-Total[edn]]]; SequencePosition[f/@Range[404000],{x_,x_}][[;;,1]] (* Harvey P. Dale, Apr 28 2025 *)
  • PARI
    f(n) = -sumdiv(n, d, (-1)^d*d); \\ A002129
    isok(k) = f(k) + f(k+1) == 0; \\ Michel Marcus, Oct 24 2021

A333408 Numbers k such that s(k) = s(k+1), where s(k) is the unitary analog of the alternating sum-of-divisors function (A307037).

Original entry on oeis.org

1, 11, 71, 155, 194, 204, 1119, 1420, 1628, 3705, 5186, 14363, 19788, 20467, 25180, 25545, 25843, 28251, 30804, 42811, 60204, 63180, 71791, 73260, 83600, 87219, 87308, 91539, 97432, 99208, 100456, 100471, 119315, 122616, 132308, 135340, 135864, 164691, 166624
Offset: 1

Views

Author

Amiram Eldar, Mar 19 2020

Keywords

Examples

			1 is a term since s(1) = s(2) = 1;
11 is a term since s(11) = s(12) = 10;
		

Crossrefs

The unitary version of A206368.

Programs

  • Mathematica
    f[p_, e_] := p^e + (-1)^e; s[1] = 1; s[n_] := Times @@ f @@@ FactorInteger[n]; seq = {}; s1 = 1;  Do[s2 = s[n]; If[s1 == s2, AppendTo[seq, n - 1]]; s1 = s2, {n, 2, 10^5}]; seq

A348586 Numbers k such that abs(A328258(k)) = abs(A328258(k+1)).

Original entry on oeis.org

1, 11, 40, 179, 695, 928, 991, 1079, 2772, 2799, 2839, 6687, 7632, 7739, 7960, 8568, 9347, 10703, 11008, 11472, 12847, 12935, 13580, 14064, 16000, 16260, 17135, 20944, 26432, 27999, 35399, 37236, 42251, 42756, 44199, 55308, 56419, 68976, 70127, 74671, 77748, 83099
Offset: 1

Views

Author

Amiram Eldar, Oct 24 2021

Keywords

Comments

Equivalently, numbers k such that A328258(k) = -A328258(k+1).

Examples

			1 is a term since abs(A328258(1)) = abs(A328258(2)) = 1.
11 is a term since abs(A328258(11)) = abs(A328258(12)) = 12.
		

Crossrefs

The unitary version of A348585.
Cf. A328258.
Similar sequences: A002961, A064125, A206368, A333261.

Programs

  • Mathematica
    f[p_, e_] := 1 - (-1)^p*(p^e); s[1] = 1; s[n_] := Abs[Times @@ (f @@@ FactorInteger[n])]; Select[Range[10^5], s[#] == s[# + 1] &]
  • PARI
    f(n) = sumdiv(n, d, if (gcd(d, n/d) == 1, (-1)^(d + 1) * d)); \\ A328258
    isok(k) = f(k) + f(k+1) == 0; \\ Michel Marcus, Oct 24 2021
Showing 1-6 of 6 results.