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.

A005065 Sum of 4th powers of primes dividing n.

Original entry on oeis.org

0, 16, 81, 16, 625, 97, 2401, 16, 81, 641, 14641, 97, 28561, 2417, 706, 16, 83521, 97, 130321, 641, 2482, 14657, 279841, 97, 625, 28577, 81, 2417, 707281, 722, 923521, 16, 14722, 83537, 3026, 97, 1874161, 130337, 28642, 641, 2825761, 2498, 3418801, 14657, 706, 279857, 4879681, 97, 2401, 641, 83602, 28577, 7890481, 97
Offset: 1

Views

Author

Keywords

Comments

Primes are taken without multiplicity, e.g., 12 = 2*2*3, and a(12) = 2^4+3^4 = 97. - Harvey P. Dale, Jul 16 2014
Inverse Möbius transform of n^4 * c(n), where c(n) is the prime characteristic (A010051). - Wesley Ivan Hurt, Jun 22 2024

Crossrefs

Column k=4 of A322080.
Sum of the k-th powers of the primes dividing n for k=0..10 : A001221 (k=0), A008472 (k=1), A005063 (k=2), A005064 (k=3), this sequence (k=4), A351193 (k=5), A351194 (k=6), A351195 (k=7), this sequence (k=8), A351197 (k=9), A351198 (k=10).
Cf. A010051.

Programs

  • Maple
    A005065 := proc(n)
            add(d^4, d= numtheory[factorset](n)) ;
    end proc;
    seq(A005065(n),n=1..40) ; # R. J. Mathar, Nov 08 2011
  • Mathematica
    Join[{0},Table[Total[Transpose[FactorInteger[n]][[1]]^4],{n,2,40}]] (* Harvey P. Dale, Jul 16 2014 *)
    Array[DivisorSum[#, #^4 &, PrimeQ] &, 54] (* Michael De Vlieger, Jul 11 2017 *)
  • PARI
    a(n) = my(f=factor(n)); sum(k=1, #f~, f[k,1]^4); \\ Michel Marcus, Jul 11 2017
  • Python
    from sympy import primefactors
    def a(n): return sum(p**4 for p in primefactors(n))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jul 11 2017
    
  • Scheme
    (define (A005065 n) (if (= 1 n) 0 (+ (A000583 (A020639 n)) (A005065 (A028234 n))))) ;; Antti Karttunen, Jul 10 2017
    

Formula

Additive with a(p^e) = p^4.
From Antti Karttunen, Jul 11 2017: (Start)
a(n) = A005068(n) + 16*A059841(n).
a(n) = A005081(n) + A005085(n) + 16*A059841(n).
a(n) = A005073(n) + A005077(n) + 81*A079978(n).
(End)
G.f.: Sum_{k>=1} prime(k)^4*x^prime(k)/(1 - x^prime(k)). - Ilya Gutkovskiy, Dec 24 2018
a(n) = Sum_{p|n, p prime} p^4. - Wesley Ivan Hurt, Feb 04 2022
a(n) = Sum_{d|n} d^4 * c(d), where c = A010051. - Wesley Ivan Hurt, Jun 22 2024

Extensions

More terms from Antti Karttunen, Jul 10 2017

A005083 Sum of squares of primes = 3 mod 4 dividing n.

Original entry on oeis.org

0, 0, 9, 0, 0, 9, 49, 0, 9, 0, 121, 9, 0, 49, 9, 0, 0, 9, 361, 0, 58, 121, 529, 9, 0, 0, 9, 49, 0, 9, 961, 0, 130, 0, 49, 9, 0, 361, 9, 0, 0, 58, 1849, 121, 9, 529, 2209, 9, 49, 0, 9, 0, 0, 9, 121, 49, 370, 0, 3481, 9, 0, 961, 58, 0, 0, 130, 4489, 0, 538, 49, 5041, 9, 0, 0, 9, 361, 170, 9, 6241, 0, 9, 0, 6889, 58
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Array[DivisorSum[#, #^2 &, And[PrimeQ@ #, Mod[#, 4] == 3] &] &, 84] (* Michael De Vlieger, Jul 11 2017 *)
    f[p_, e_] := If[Mod[p, 4] == 3, p^2, 0]; a[n_] := Plus @@ f @@@ FactorInteger[n]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jun 21 2022 *)
  • PARI
    a(n) = my(f=factor(n)); sum(k=1, #f~, if (((p=f[k,1])%4) == 3, p^2)); \\ Michel Marcus, Jul 11 2017
  • Scheme
    (define (A005083 n) (if (= 1 n) 0 (+ (if (= 3 (modulo (A020639 n) 4)) (A000290 (A020639 n)) 0) (A005083 (A028234 n))))) ;; Antti Karttunen, Jul 11 2017
    

Formula

Additive with a(p^e) = p^2 if p = 3 (mod 4), 0 otherwise.
a(n) = A005063(n) - A005079(n) - 4*A059841(n). - Antti Karttunen, Jul 11 2017

Extensions

More terms from Antti Karttunen, Jul 11 2017

A005081 Sum of 4th powers of primes = 1 mod 4 dividing n.

Original entry on oeis.org

0, 0, 0, 0, 625, 0, 0, 0, 0, 625, 0, 0, 28561, 0, 625, 0, 83521, 0, 0, 625, 0, 0, 0, 0, 625, 28561, 0, 0, 707281, 625, 0, 0, 0, 83521, 625, 0, 1874161, 0, 28561, 625, 2825761, 0, 0, 0, 625, 0, 0, 0, 0, 625, 83521, 28561, 7890481, 0, 625, 0, 0, 707281, 0, 625, 13845841, 0, 0, 0, 29186, 0, 0, 83521, 0, 625, 0, 0, 28398241
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Array[DivisorSum[#, #^4 &, And[PrimeQ@ #, Mod[#, 4] == 1] &] &, 73] (* Michael De Vlieger, Jul 11 2017 *)
    f[p_, e_] := If[Mod[p, 4] == 1, p^4, 0]; a[n_] := Plus @@ f @@@ FactorInteger[n]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jun 21 2022 *)
  • PARI
    a(n) = my(f=factor(n)); sum(k=1, #f~, if (((p=f[k,1])%4) == 1, p^4)); \\ Michel Marcus, Jul 11 2017
  • Scheme
    (define (A005081 n) (if (= 1 n) 0 (+ (if (= 1 (modulo (A020639 n) 4)) (A000583 (A020639 n)) 0) (A005081 (A028234 n))))) ;; Antti Karttunen, Jul 11 2017
    

Formula

Additive with a(p^e) = p^4 if p = 1 (mod 4), 0 otherwise.
a(n) = A005065(n) - A005085(n) - 16*A059841(n). - Antti Karttunen, Jul 11 2017

Extensions

More terms from Antti Karttunen, Jul 11 2017

A005082 Sum of primes = 3 mod 4 dividing n.

Original entry on oeis.org

0, 0, 3, 0, 0, 3, 7, 0, 3, 0, 11, 3, 0, 7, 3, 0, 0, 3, 19, 0, 10, 11, 23, 3, 0, 0, 3, 7, 0, 3, 31, 0, 14, 0, 7, 3, 0, 19, 3, 0, 0, 10, 43, 11, 3, 23, 47, 3, 7, 0, 3, 0, 0, 3, 11, 7, 22, 0, 59, 3, 0, 31, 10, 0, 0, 14, 67, 0, 26, 7, 71, 3, 0, 0, 3, 19, 18, 3, 79, 0, 3, 0, 83, 10, 0, 43, 3, 11, 0, 3, 7, 23, 34, 47, 19, 3, 0, 7, 14, 0, 0, 3, 103
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Formula

Additive with a(p^e) = p if p = 3 (mod 4), 0 otherwise.
From Antti Karttunen, Jul 11 2017: (Start)
a(1) = 0; for n > 1, a(n) = (A079978(A020639(n) mod 4)*A020639(n)) + a(A028234(n)).
a(n) = A008472(n) - A005078(n) - 2*A059841(n).
(End)

Extensions

More terms from Antti Karttunen, Jul 11 2017

A005084 Sum of cubes of primes = 3 mod 4 dividing n.

Original entry on oeis.org

0, 0, 27, 0, 0, 27, 343, 0, 27, 0, 1331, 27, 0, 343, 27, 0, 0, 27, 6859, 0, 370, 1331, 12167, 27, 0, 0, 27, 343, 0, 27, 29791, 0, 1358, 0, 343, 27, 0, 6859, 27, 0, 0, 370, 79507, 1331, 27, 12167, 103823, 27, 343, 0, 27, 0, 0, 27, 1331, 343, 6886, 0, 205379, 27, 0, 29791, 370, 0, 0, 1358, 300763, 0, 12194, 343, 357911
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Array[DivisorSum[#, #^3 &, And[PrimeQ@ #, Mod[#, 4] == 3] &] &, 71] (* Michael De Vlieger, Jul 11 2017 *)
    f[p_, e_] := If[Mod[p, 4] == 3, p^3, 0]; a[n_] := Plus @@ f @@@ FactorInteger[n]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jun 21 2022 *)
  • PARI
    a(n) = my(f=factor(n)); sum(k=1, #f~, if (((p=f[k,1])%4) == 3, p^3)); \\ Michel Marcus, Jul 11 2017
  • Scheme
    (define (A005084 n) (if (= 1 n) 0 (+ (if (= 3 (modulo (A020639 n) 4)) (A000578 (A020639 n)) 0) (A005084 (A028234 n))))) ;;  Antti Karttunen, Jul 11 2017
    

Formula

Additive with a(p^e) = p^3 if p = 3 (mod 4), 0 otherwise.
a(n) = A005064(n) - A005080(n) - 8*A059841(n). - Antti Karttunen, Jul 11 2017

Extensions

More terms from Antti Karttunen, Jul 11 2017

A318281 a(n+1) = a(n-a(n)) if a(n-1) != a(n), otherwise a(n+1) = a(n) + 3; a(1) = a(2) = a(3) = a(4) = 1.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 4, 1, 4, 4, 7, 1, 7, 1, 7, 1, 7, 4, 1, 4, 1, 4, 4, 7, 7, 10, 1, 10, 4, 7, 4, 1, 4, 4, 7, 10, 10, 13, 7, 1, 7, 4, 13, 7, 10, 7, 7, 10, 13, 10, 1, 10, 4, 13, 7, 10, 7, 10, 10, 13, 7, 13, 13, 16, 10, 7, 10
Offset: 1

Views

Author

Rok Cestnik, Aug 23 2018

Keywords

Comments

Sequences with an analogous condition a(n+1) = a(n) + s for s != 3 tend towards repetitive patterns:
for even values of s this is obvious, e.g.:
s = 2: 1,1,1,3,1,3,1,3,... (1,3 repeats)
s = 4: 1,1,1,1,1,5,1,5,1,5,1,5,... (1,5 repeats)
for odd values of s it has been checked up to s <= 19:
s = 1: 1,1,2,1,2,2,3,1,3,2,1,2,2,3,1,3,... (2,1,2,2,3,1,3 repeats)
s = 5: settles to a repetitive pattern of 192 terms
s = 7: settles to a repetitive pattern of 25 terms
s = 9: settles to a repetitive pattern of 31 terms
s = 11: settles to a repetitive pattern of 37 terms
s = 13: settles to a repetitive pattern of 43 terms
s = 15: settles to a repetitive pattern of 49 terms
s = 17: settles to a repetitive pattern of 55 terms
s = 19: settles to a repetitive pattern of 61 terms
It appears that for further values of s such sequences settle to a repetitive pattern of 4 + 3*s terms.

Examples

			a(5) = a(4) + 3 = 4, because a(3) == a(4).
a(6) = a(5-a(5)) = a(1) = 1, because a(4) != a(5).
		

Crossrefs

See A318282 for (a(n)-1)/3.

Programs

  • C
    #include
    #include
    #include
    int main(void){
      int N = 100; //number of terms
      int *a = (int*)malloc((N+1)*sizeof(int));
      printf("1 1\n2 1\n3 1\n4 1\n");
      a[1] = 1;
      a[2] = 1;
      a[3] = 1;
      a[4] = 1;
      for(int i = 4; i < N; ++i){
        if(a[i-1] != a[i]) a[i+1] = a[i-a[i]];
        else a[i+1] = a[i]+3;
        printf("%d %d\n", i+1, a[i+1]);
      }
      free(a);
      return 0;
    }
Showing 1-6 of 6 results.