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.

A157512 Partial sums of A157502.

Original entry on oeis.org

2, 8, 16, 26, 38, 52, 70, 90, 112, 136, 162, 190, 220, 252, 286, 324, 364, 406, 450, 496, 544, 594, 646, 700, 756, 814, 874, 936, 1002, 1070, 1140, 1212, 1286, 1362, 1440, 1520, 1602, 1686, 1772, 1860, 1950, 2042, 2136, 2232, 2330, 2432, 2536
Offset: 1

Views

Author

Gerald Hillier, Mar 02 2009

Keywords

Examples

			a(4) = 2 + 6 + 8 + 10 = 26.
		

Crossrefs

Cf. A157502.

Programs

  • PARI
    lista(nn) = {s = 0; forstep (i = 2, nn, 2, if (! issquare(i), s+=i; print1(s, ", ");););} \\ Michel Marcus, Aug 26 2013

Formula

Set R(n) = floor(A157502(n)/2) and S(n) = floor(sqrt(A157502(n))/2); then a(n) = R(n)*(R(n) + 1) - (4*S(n)^3 + 6*S(n)^2 + 2*S(n))/3.

Extensions

More terms from Michel Marcus, Aug 26 2013

A182664 a(n) = A088828(n) + A157502(n).

Original entry on oeis.org

5, 11, 15, 21, 25, 29, 35, 39, 43, 47, 53, 57, 61, 65, 69, 75, 79, 83, 87, 91, 95, 101, 105, 109, 113, 117, 121, 125, 131, 135, 139, 143, 147, 151, 155, 159, 165, 169, 173, 177, 181, 185, 189, 193, 197, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, 245
Offset: 1

Views

Author

Ed Smiley, Dec 23 2012

Keywords

Crossrefs

Cf. A088828 and A157502. Also alternate generation formula related to A000217, A010054.

Programs

  • Mathematica
    Module[{nn=60,tb},tb=2*Accumulate[Table[If[IntegerQ[(Sqrt[8n+1]-1)/2],1,0],{n,nn}]];Join[{5},Table[1+4i+tb[[i-1]],{i,2,nn}]]] (* Harvey P. Dale, Jul 22 2013 *)

Formula

Let T(n) be 1 if positive n is a triangular number, else 0; we also define T(0) as 0. Then we can also write this sequence as 1 + 4*n + 2*[T(1) + T(2) ... T(n-1)]. (Other than the special definition for T(0), T(n) is essentially A010054.)
The sequence can also be seen visually as
1 + 4
1 + 4 + 6
1 + 4 + 6 + 4
1 + 4 + 6 + 4 + 4
1 + 4 + 6 + 4 + 4 + 6
1 + 4 + 6 + 4 + 4 + 6 + 4
1 + 4 + 6 + 4 + 4 + 6 + 4 + 4
1 + 4 + 6 + 4 + 4 + 6 + 4 + 4 + 4
1 + 4 + 6 + 4 + 4 + 6 + 4 + 4 + 4 + 6...

A088828 Nonsquare positive odd numbers.

Original entry on oeis.org

3, 5, 7, 11, 13, 15, 17, 19, 21, 23, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 123, 125, 127, 129, 131, 133, 135, 137, 139
Offset: 1

Views

Author

Labos Elemer, Oct 28 2003

Keywords

Comments

Odd numbers with even abundance: primes and some composites too.
Odd numbers with odd abundance are in A016754. Even numbers with odd abundance are in A088827. Even numbers with even abundance are in A088829.
Or, odd numbers without the squares. - Gerald Hillier, Apr 12 2009

Examples

			n = p prime, abundance = 1 - p = even and negative;
n = 21, sigma = 1 + 3 + 7 + 21 = 32, abundance = 32 - 42 = -20.
		

Crossrefs

Programs

  • Magma
    [ n: n in [1..140 by 2] | IsEven(SumOfDivisors(n)-2*n) ]; // Klaus Brockhaus, Apr 15 2009
    
  • Mathematica
    Do[s=DivisorSigma[1, n]-2*n; If[ !OddQ[s]&&OddQ[n], Print[{n, s}]], {n, 1, 1000}]
    Select[Range[1, 500, 2], EvenQ[DivisorSigma[1, #] - 2 #] &] (* Vladimir Joseph Stephan Orlovsky, Apr 15 2011 *)
  • PARI
    isok(n) = (n>0) && (n % 2) && ! issquare(n); \\ Michel Marcus, Aug 28 2013
    
  • Python
    from itertools import count, islice
    from sympy.ntheory.primetest import is_square
    def A088828_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:not is_square(n),count(max(startvalue+(startvalue&1^1),1),2))
    A088828_list = list(islice(A088828_gen(),30)) # Chai Wah Wu, Jul 06 2023
    
  • Python
    from math import isqrt
    def A088828(n): return (s:=(m:=isqrt(k:=(n<<1)-1))+(k-m*(m+1)>=1))+k+(s&1) # Chai Wah Wu, Jun 19 2024

Formula

a(n) = 2*n + s - ((s+1) mod 2) where s = round(sqrt(2*n-1)). - Gerald Hillier, Apr 15 2009
A005408 SETMINUS A016754. - R. J. Mathar, Jun 16 2018
a(n) = 2*(n+h) + 1 where h = floor((1/4)*(sqrt(8*n) - 1)) is the largest value such that A014105(h) < n. - John Tyler Rascoe, Jul 05 2022

Extensions

Entry revised by N. J. A. Sloane, Jan 31 2014 at the suggestion of Omar E. Pol

A128201 Union of positive squares and the odd numbers.

Original entry on oeis.org

1, 3, 4, 5, 7, 9, 11, 13, 15, 16, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 36, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 64, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 100, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 04 2007

Keywords

Comments

Range of A128200.
Positive numbers n such that n^((1 + n)/2) is an integer. - Gionata Neri, May 07 2016

Crossrefs

Partial sums given by A157130. - Gerald Hillier, Feb 25 2009
See A176693 for the union of even numbers and the squares. - M. F. Hasler, Apr 19 2015

Programs

  • Mathematica
    f[n_] := Block[{s = Range[n]^2, t}, Union[s, Range[1, Last@ s, 2]] // Sort]; f@ 12 (* Michael De Vlieger, Apr 16 2015 *)
  • PARI
    A128201(n)=!(bittest(n=2*n-round(sqrt(2*n)),0)||issquare(n))+n \\ Based on Hiliers's formula. - M. F. Hasler, Apr 19 2015
    
  • PARI
    is_A128201(n)=bittest(n,0)||issquare(n) \\ M. F. Hasler, Apr 19 2015
    
  • Python
    from math import isqrt
    def A128201(n):
        def f(x): return n+(x>>1)-(isqrt(x)>>1)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Oct 02 2024

Formula

a(n) = f(n,1,1,2), where f(n,i,m,x) = if i=n then m; else if m+1=x^2 then f(n,i+1,m+1,x); else if m+1>x^2 then f(n,i+1,m+1,x+2); else f(n,i+1,m+2,x).
Set R(n) = 2*n - round(sqrt(2*n)); then a(n) = R(n) + sign(frac(sqrt(R(n)))) * (not(R(n) mod 2)). - Gerald Hillier, Apr 16 2015

A346316 Composite numbers with primitive root 6.

Original entry on oeis.org

121, 169, 289, 1331, 1681, 2197, 3481, 3721, 4913, 6241, 6889, 7921, 10609, 11449, 11881, 12769, 14641, 16129, 17161, 18769, 22801, 24649, 28561, 32041, 39601, 49729, 51529, 52441, 54289, 63001, 66049, 68921, 73441, 76729, 83521, 120409, 134689, 139129, 157609
Offset: 1

Views

Author

Robert Hutchins, Jul 13 2021

Keywords

Comments

An alternative description: Numbers k such that 1/k in base 6 generates a repeating fraction with period phi(n) and n/2 < phi(n) < n-1.
For example, in base 6, 1/121 has repeat length 110 = phi(121) which is > 121/2 but less than 121-1.

Crossrefs

Subsequence of A244623.
Subsequence of A167794.
Cf. A108989 (for base 2), A158248 (for base 10).
Cf. A157502.

Programs

  • Maple
    isA033948 := proc(n)
        if n in {1,2,4} then
            true;
        elif type(n,'odd') and nops(numtheory[factorset](n)) = 1 then
            true;
        elif type(n,'even') and type(n/2,'odd') and nops(numtheory[factorset](n/2)) = 1 then
            true;
        else
            false;
        end if;
    end proc:
    isA167794 := proc(n)
        if not isA033948(n) or n = 1 then
            false;
        elif numtheory[order](6,n) = numtheory[phi](n) then
            true;
        else
            false;
        end if;
    end proc:
    A346316 := proc(n)
        option remember;
        local a;
        if n = 1 then
            121;
        else
            for a from procname(n-1)+1 do
                if not isprime(a) and isA167794(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A346316(n),n=1..20) ; # R. J. Mathar, Sep 15 2021
  • Mathematica
    Select[Range[160000], CompositeQ[#] && PrimitiveRoot[#, 6] == 6 &] (* Amiram Eldar, Jul 13 2021 *)
  • PARI
    isok(m) = (m>1) && !isprime(m) && (gcd(m, 6)==1) && (znorder(Mod(6, m))==eulerphi(m)); \\ Michel Marcus, Aug 12 2021

Formula

A167794 INTERSECT A002808.

A377539 The number of iterations of the map x -> x + A000005(x), starting from n, until reaching an even number, and always at least one iteration taken.

Original entry on oeis.org

1, 1, 4, 3, 3, 1, 2, 1, 1, 1, 6, 1, 5, 1, 4, 3, 4, 1, 3, 1, 2, 1, 2, 1, 1, 1, 16, 1, 16, 1, 15, 1, 14, 1, 13, 11, 13, 1, 12, 1, 12, 1, 11, 1, 10, 1, 2, 1, 1, 1, 9, 1, 9, 1, 8, 1, 7, 1, 7, 1, 6, 1, 5, 5, 5, 1, 5, 1, 4, 1, 4, 1, 3, 1, 2, 1, 2, 1, 2, 1, 1, 1, 38, 1, 37, 1, 36, 1, 36, 1, 35, 1, 35
Offset: 1

Views

Author

Ctibor O. Zizka, Oct 31 2024

Keywords

Comments

The iteration step is x -> A062249(x).
a(n) = 1 if and only if n is an odd square (A016754) or an even nonsquare (A157502). - Robert Israel, Oct 31 2024
Therefore, a(n) = 1 <=> A323158(n) = 0. - Antti Karttunen, Jan 15 2025

Examples

			For n = 2, there is a(2) = 1 iteration to an even number: 2 -> 4 (with at least one iteration so 2 itself is not the even number target).
For n = 3 there are a(3) = 4 iterations to reach an even number: 3 -> 5 -> 7 -> 9 -> 12.
		

Crossrefs

Cf. A000005, A062249 (step), A064491 (trajectory of 1), A016754, A157502, A323158.

Programs

  • Maple
    f:= proc(n) local x,i;
      x:= n;
      for i from 1 do x:= x + numtheory:-tau(x); if x::even then return i fi od
    end proc:
    map(f, [$1..200]); # Robert Israel, Oct 31 2024
  • Mathematica
    a[n_] := -1 + Length@ NestWhileList[# + DivisorSigma[0, #] &, n, OddQ, {2, 1}]; Array[a, 100] (* Amiram Eldar, Oct 31 2024 *)
  • PARI
    A377539(n) = for(i=1,oo,if(!((n=(n+numdiv(n)))%2),return(i))); \\ Antti Karttunen, Jan 15 2025
Showing 1-6 of 6 results.