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

A038387 a(n) is the smallest number such that the arithmetic mean (A) and geometric mean (G) of n and a(n) are both integers.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 2, 1, 10, 11, 12, 13, 14, 15, 4, 17, 2, 19, 20, 21, 22, 23, 6, 1, 26, 3, 28, 29, 30, 31, 2, 33, 34, 35, 4, 37, 38, 39, 10, 41, 42, 43, 44, 5, 46, 47, 12, 1, 2, 51, 52, 53, 6, 55, 14, 57, 58, 59, 60, 61, 62, 7, 4, 65, 66, 67, 68, 69, 70, 71, 2, 73, 74, 3, 76, 77, 78
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[k = 1; While[Nand @@ IntegerQ /@ {(n + k)/2, Sqrt[n*k]}, k++]; k, {n, 78}] (* Jayanta Basu, Jul 14 2013 *)
    f[p_, e_] := If[OddQ[e], p, If[p == 2, 4, 1]]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 09 2020 *)
  • PARI
    a(n)={for(k=1, n, if((n+k)%2==0 && issquare(n*k), return(k)))} \\ Andrew Howroyd, Feb 12 2018
    
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i,2]%2, f[i,1], if(f[i,1]==2, 4, 1)));} \\ Amiram Eldar, Oct 27 2022

Formula

If n is odd with prime factorization p1^j1*p2^j2*...pk^jk then f(n)=p1^(j1 mod 2)*p2^(j2 mod 2)*... If n is even then f(n)=2^(2-(j1 mod 2))*p2^(j2 mod 2)*... f(n)=n whenever n is squarefree or n/2 is squarefree. (Christian G. Bower)
Multiplicative with a(p^e) = p if e is odd, 4 if p=2 and e is even, 1 if p>2 and e is even. - Vladeta Jovovic, May 15 2003
Sum_{k=1..n} a(k) ~ c * n^2, where c = 3*Pi^2/80 = 0.3701101... . - Amiram Eldar, Oct 27 2022

Extensions

More terms from Vladeta Jovovic, May 15 2003

A038389 Let f(n) be the smallest number such that the arithmetic mean (A) and geometric mean (G) of n and f(n) are both integers; sequence gives A values.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 5, 5, 10, 11, 12, 13, 14, 15, 10, 17, 10, 19, 20, 21, 22, 23, 15, 13, 26, 15, 28, 29, 30, 31, 17, 33, 34, 35, 20, 37, 38, 39, 25, 41, 42, 43, 44, 25, 46, 47, 30, 25, 26, 51, 52, 53, 30, 55, 35, 57, 58, 59, 60, 61, 62, 35, 34, 65, 66, 67, 68, 69, 70, 71, 37, 73, 74, 39, 76, 77, 78
Offset: 1

Views

Author

Keywords

Comments

It is the average of A038387 with n, both of which are multiplicative. - Christian G. Bower, May 16 2005
However, this sequence is not multiplicative. The first nonmultiplicative term is a(72) = 37 which is not multiplicative since a(8)*a(9) = 5*5 = 25. - Andrew Howroyd, Feb 12 2018

Crossrefs

Programs

  • Mathematica
    Table[k = 1; While[Nand @@ IntegerQ /@ {a = (n + k)/2, Sqrt[n*k]}, k++]; a, {n, 78}] (* Jayanta Basu, Jul 14 2013 *)
  • PARI
    a(n)={for(k=1, n, if((n+k)%2==0 && issquare(n*k), return((n+k)/2)))} \\ Andrew Howroyd, Feb 12 2018
Showing 1-2 of 2 results.