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

A191217 Numbers n such that sigma(n) is congruent to 2 modulo 4.

Original entry on oeis.org

5, 10, 13, 17, 20, 26, 29, 34, 37, 40, 41, 45, 52, 53, 58, 61, 68, 73, 74, 80, 82, 89, 90, 97, 101, 104, 106, 109, 113, 116, 117, 122, 136, 137, 146, 148, 149, 153, 157, 160, 164, 173, 178, 180, 181, 193, 194, 197, 202, 208, 212, 218, 226, 229, 232, 233, 234, 241, 244, 245, 257, 261, 269
Offset: 1

Views

Author

Luis H. Gallardo, May 26 2011

Keywords

Comments

These numbers are exactly the numbers of the form 2^a * p^(4b+1) * m^2 where p is a prime number congruent to 1 modulo 4, a is a nonnegative integer, and m is a positive integer coprime to p. In particular, they are also sums of two squares: the sequence has the first 12 terms in common with A132777.
I corrected the above comment by adding the exponent (4b+1) to p, because otherwise it would miss terms like a(614) = 3125 = 5^5, a(1140) = 6250 = 2 * 5^5, a(4421) = 28125 = 5^5 * 3^2, etc. - Antti Karttunen, May 25 2022

Examples

			For n=2, a(2) = 10 since sigma(10) = 18 = 4*4 + 2 is congruent to 2 modulo 4
		

Crossrefs

Similar to, but different from, A230779, which is a subsequence.
Cf. A191218, A228058, A332226 for other subsequences.
Cf. A353812 (characteristic function).

Programs

  • Maple
    with(numtheory): gen := proc(b) local n,s,d; for n from 1 to b do s := sigma(n);
    if modp(s,4)=2 then print(n); fi; od; end;
  • PARI
    for(n=1,10^3,if(2==(sigma(n)%4),print1(n,", "))) /* Joerg Arndt, May 27 2011 */

A230486 Numbers n such that n^n is representable as the sum of two nonzero squares.

Original entry on oeis.org

5, 10, 13, 17, 20, 25, 26, 29, 30, 34, 37, 40, 41, 50, 52, 53, 58, 60, 61, 65, 68, 70, 73, 74, 78, 80, 82, 85, 89, 90, 97, 100, 101, 102, 104, 106, 109, 110, 113, 116, 120, 122, 125, 130, 136, 137, 140, 145, 146, 148, 149, 150, 156, 157, 160, 164, 169, 170
Offset: 1

Views

Author

Alex Ratushnyak, Oct 20 2013

Keywords

Comments

If n is even, then n must have a prime factor of the form 4k+1. If n is odd, then all prime factors must be of the form 4k+1. - T. D. Noe, Oct 21 2013
The above is also a sufficient condition: the sequence consists exactly in even multiples of Pythagorean primes A002144, and products of such primes (A008846). - M. F. Hasler, Sep 02 2018

Examples

			5^5 = 55^2 + 10^2.
10^10 = 99712^2 + 7584^2.
13^13 = 17106843^2 + 3198598^2.
17^17 = 28735037644^2 + 1240110271^2.
		

References

  • G. H. Hardy and E. M. Wright, Theory of Numbers, Oxford, Sixth Edition, 2008, p. 395.

Crossrefs

Cf. A000312 (n^n), A004431, A132777.
A subsequence of A000404 (numbers that are the sum of 2 nonzero squares).
Sequence A002144 (primes of the form 4k + 1) and A008846 (products of such primes) are subsequences.

Programs

  • Mathematica
    t = {}; Do[f = FactorInteger[n]; p = Transpose[f][[1]]; If[EvenQ[n], If[MemberQ[Mod[p, 4], 1], AppendTo[t, n]], If[Union[Mod[p, 4]] == {1}, AppendTo[t, n]]], {n, 2, 200}]; t (* T. D. Noe, Oct 21 2013 *)
  • PARI
    select( is_A230486(n)={(n=factor(n)[,1]%4) && if(n[1]==2, Set(n)[1]==1, Set(n)==[1])}, [1..200]) \\ M. F. Hasler, Sep 02 2018
    
  • Python
    from itertools import count, islice
    from sympy import primefactors
    def A230486_gen(startvalue=2): # generator of terms >= startvalue
        return filter(lambda n:all(p&3==1 for p in primefactors(n)) if n&1 else any(p&3==1 for p in primefactors(n)),count(max(startvalue,2)))
    A230486_list = list(islice(A230486_gen(),20)) # Chai Wah Wu, May 15 2023

Formula

A230486 = { n | A000312(n) is in A000404 } = A004277*A002144 U A008846. - M. F. Hasler, Sep 02 2018

Extensions

Extended by T. D. Noe, Oct 21 2013

A362110 a(n) is the smallest integer k such that n can be expressed as the arithmetic mean of k distinct nonzero squares, or 0 if no such k exists.

Original entry on oeis.org

1, 0, 0, 1, 2, 0, 3, 0, 1, 2, 5, 0, 2, 3, 3, 1, 2, 3, 5, 2, 4, 3, 3, 5, 1, 2, 3, 3, 2, 3, 3, 5, 5, 2, 3, 1, 2, 3, 3, 2, 2, 3, 3, 5, 2, 3, 3, 5, 1, 2, 3, 2, 2, 3, 3, 3, 3, 2, 4, 3, 2, 3, 3, 1, 2, 3, 3, 2, 4, 3, 3, 3, 2, 2, 3, 5, 4, 3, 3, 2, 1, 2, 3, 4, 2, 3, 3, 3, 2, 2, 3, 3, 4, 3, 3, 5, 2, 3, 3
Offset: 1

Views

Author

Yifan Xie, Apr 16 2023

Keywords

Examples

			For n = 2, if k = 1, 2*1 = 2 is not a square; but, from the upper bound formula, (k + 1) * (2*k + 1) <= 12, so k <= 1. So, a satisfactory k does not exist; hence a(2) = 0.
		

Crossrefs

Cf. A360530 (allows repeated squares).

Formula

Upper bound: (a(n) + 1) * (2*a(n) + 1) <= 6*n. Proof: Because (Sum_{m=1..k} (i_m)^2)/k = n, n*k = Sum_{m=1..k} (i_m)^2. Since each i_m is distinct, n*k >= Sum_{m=1..k} m^2 = k * (k + 1) * (2*k + 1)/6, hence (k + 1) * (2*k + 1) <= 6*n.
a(A132777(n)) = 2. - Thomas Scheuerle, Apr 16 2023

Extensions

Name qualified and other edits by Peter Munn, Apr 21 2023
Showing 1-3 of 3 results.