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.

Previous Showing 11-20 of 24 results. Next

A339597 When 2*n+1 first appears in A086799.

Original entry on oeis.org

1, 2, 5, 4, 9, 10, 13, 8, 17, 18, 21, 20, 25, 26, 29, 16, 33, 34, 37, 36, 41, 42, 45, 40, 49, 50, 53, 52, 57, 58, 61, 32, 65, 66, 69, 68, 73, 74, 77, 72, 81, 82, 85, 84, 89, 90, 93, 80, 97, 98, 101, 100, 105, 106, 109, 104, 113, 114, 117, 116, 121, 122, 125, 64, 129, 130, 133, 132, 137
Offset: 0

Views

Author

Marc LeBrun and N. J. A. Sloane, Jan 06 2021

Keywords

Crossrefs

Cf. A086799, A091072 (terms sorted), A129760.

Programs

  • Maple
    N := 127: # for a(0) to a(N)
    V := Array(0..N): count := 0:
    for i from 1 while count < N+1 do
      with(MmaTranslator[Mma]):
      f(i) := BitOr(i,i-1);
      v := (f(i)-1)/2;
      if v <= N and V[v] = 0 then count := count+1; V[v] := i fi
    od:
    convert(V,list); # Robert Israel, Jan 07 2021
  • PARI
    f(n) = bitor(n, n-1); \\ A086799
    a(n) = my(k=1); while (f(k) != 2*n+1, k++); k; \\ Michel Marcus, Jan 07 2021
    
  • PARI
    a(n) = n++; n<<1 - 1<Kevin Ryde, Mar 29 2021
    
  • Python
    def A339597(n): return ((m:=n+1)<<1)-(m&-m) # Chai Wah Wu, Sep 01 2023

Formula

a(n) = 2*(n+1) - A006519(n+1) = n+1 with a 0 bit inserted above its least significant 1-bit. - Kevin Ryde, Mar 29 2021
a(n) = A129760(n+1) + n+1. - Christian Krause, May 05 2021

A069562 Numbers, m, whose odd part (largest odd divisor, A000265(m)) is a nontrivial square.

Original entry on oeis.org

9, 18, 25, 36, 49, 50, 72, 81, 98, 100, 121, 144, 162, 169, 196, 200, 225, 242, 288, 289, 324, 338, 361, 392, 400, 441, 450, 484, 529, 576, 578, 625, 648, 676, 722, 729, 784, 800, 841, 882, 900, 961, 968, 1058, 1089, 1152, 1156, 1225, 1250, 1296, 1352, 1369
Offset: 1

Views

Author

Benoit Cloitre, Apr 18 2002

Keywords

Comments

Previous name: sum(d|n,6d/(2+mu(d))) is odd, where mu(.) is the Moebius function, A008683.
From Peter Munn, Jul 06 2020: (Start)
Numbers that have an odd number of odd nonsquarefree divisors.
[Proof of equivalence to the name, where m denotes a positive integer:
(1) These properties are equivalent: (a) m has an even number of odd squarefree divisors; (b) m has a nontrivial odd part.
(2) These properties are equivalent: (a) m has an odd number of odd divisors; (b) the odd part of m is square.
(3) m satisfies the condition at the start of this comment if and only if (1)(a) and (2)(a) are both true or both false.
(4) The trivial odd part, 1, is a square, so (1)(b) and (2)(b) cannot both be false, which (from (1), (2)) means (1)(a) and (2)(a) cannot both be false.
(5) From (3), (4), m satisfies the condition at the start of this comment if and only if (1)(a) and (2)(a) are true.
(6) m satisfies the condition in the name if and only if (1)(b) and (2)(b) are true, which (from (1), (2)) is equivalent to (1)(a) and (2)(a) being true, and hence from (5), to m satisfying the condition at the start of this comment.]
(End)
Numbers whose sum of non-unitary divisors (A048146) is odd. - Amiram Eldar, Sep 16 2024

Examples

			To determine the odd part of 18, remove all factors of 2, leaving 9. 9 is a nontrivial square, so 18 is in the sequence. - _Peter Munn_, Jul 06 2020
		

Crossrefs

A000265, A008683 are used in definitions of this sequence.
Lists of numbers whose odd part satisfies other conditions: A028982 (square), A028983 (nonsquare), A029747 (less than 6), A029750 (less than 8), A036349 (even number of prime factors), A038550 (prime), A070776 U {1} (power of a prime), A072502 (square of a prime), A091067 (has form 4k+3), A091072 (has form 4k+1), A093641 (noncomposite), A105441 (composite), A116451 (greater than 4), A116882 (less than or equal to even part), A116883 (greater than or equal to even part), A122132 (squarefree), A229829 (7-rough), A236206 (11-rough), A260488\{0} (has form 6k+1), A325359 (proper prime power), A335657 (odd number of prime factors), A336101 (prime power).

Programs

  • Mathematica
    Select[Range[1000], (odd = #/2^IntegerExponent[#, 2]) > 1 && IntegerQ @ Sqrt[odd] &] (* Amiram Eldar, Sep 29 2020 *)
  • PARI
    upto(n) = { my(res = List()); forstep(i = 3, sqrtint(n), 2, for(j = 0, logint(n\i^2, 2), listput(res, i^2<David A. Corneth, Sep 28 2020

Formula

Sum_{n>=1} 1/a(n) = 2 * Sum_{k>=1} 1/(2*k+1)^2 = Pi^2/4 - 2 = A091476 - 2 = 0.467401... - Amiram Eldar, Feb 18 2021

Extensions

New name from Peter Munn, Jul 06 2020

A106841 Numbers m such that m, m+1 and m+2 have odd part of the form 4*k+1.

Original entry on oeis.org

8, 16, 32, 40, 64, 72, 80, 104, 128, 136, 144, 160, 168, 200, 208, 232, 256, 264, 272, 288, 296, 320, 328, 336, 360, 392, 400, 416, 424, 456, 464, 488, 512, 520, 528, 544, 552, 576, 584, 592, 616, 640, 648, 656, 672, 680, 712, 720, 744, 776, 784, 800, 808
Offset: 1

Views

Author

Ralf Stephan, May 03 2005

Keywords

Comments

Either of form 2a(m) or 32k + 8, k >= 0, 0 < m < n.
Number points of the Heighway/Harter dragon curve starting m=0 at the origin. Those m with odd part 4k+1 (A091072) are where the curve turns left. So this sequence is the first m of each run of 3 consecutive left turns. There are no runs of 4 or more since the turn at odd m alternates left and right. Bates, Bunder, and Tognetti (theorem 19 page 104), show this sequence is integers of the form 2^p*(4k+1) with p>=3. From which a(n) = 8*A091072(n) as Ralf Stephan already noted. - Kevin Ryde, Jan 28 2020
The asymptotic density of this sequence is 1/16. - Amiram Eldar, Sep 14 2024

Examples

			40/8 = 5 is 1 mod 4 and so is 41 and 42/2 = 21, thus 40 is in sequence.
		

Crossrefs

Equals 8 * A091072.

Programs

  • Mathematica
    opn[n_]:=n/2^IntegerExponent[n,2]; Transpose[Select[Partition[Range[ 1000],3,1],Mod[opn/@#,4]=={1,1,1}&]][[1]] (* Harvey P. Dale, May 15 2011 *)
  • PARI
    lista(nn) = for(k=1, nn, if(((k/2^valuation(k, 2)-1)/2)%2==0, print1(8*k, ", "))); \\ Jinyuan Wang, Jan 30 2020

A119972 a(n) = n * A034947(n).

Original entry on oeis.org

1, 2, -3, 4, 5, -6, -7, 8, 9, 10, -11, -12, 13, -14, -15, 16, 17, 18, -19, 20, 21, -22, -23, -24, 25, 26, -27, -28, 29, -30, -31, 32, 33, 34, -35, 36, 37, -38, -39, 40, 41, 42, -43, -44, 45, -46, -47, -48, 49, 50, -51, 52, 53, -54, -55, -56, 57, 58, -59, -60, 61, -62, -63, 64, 65, 66, -67, 68, 69, -70, -71, 72, 73, 74, -75
Offset: 1

Views

Author

Alford Arnold, Jun 01 2006

Keywords

Comments

Previous name was: Flag n when the first difference of the decimal encoding of the Gray code is negative. (With "flag" meaning negate n when the difference is negative.)
Merge A091072 with minus A091067 maintaining increasing absolute value.

Examples

			A003188 begins 0  1  3  2  6  7  5  4 12  13  15  14  10  11  9 ... so
A055975 begins   1  2 -1  4  1 -2 -1  8  1   2  -1  -4   1  -2  ...
Sequence         1, 2,-3, 4, 5,-6,-7, 8, 9, 10,-11,-12, 13,-14, ...
Negative terms are at positions 3,6,7,11,12,14,..., = A091067.
Positive terms are the complement, which is A091072.
		

Crossrefs

Programs

  • Maple
    isA091067 := proc(n) option remember ; if n mod 4 = 3 then RETURN(true) ; else if n mod 2 = 0 then if isA091067(n/2) then RETURN(true) ; fi ; fi ; RETURN(false) ; fi ; end: A119972 := proc(n) if isA091067(n) then -n ; else n ; fi ; end: for n from 1 to 180 do printf("%d, ",A119972(n)) ; od ; # R. J. Mathar, May 14 2007
    # second Maple program:
    a:= n-> numtheory[jacobi](-1, n)*n:
    seq(a(n), n=1..75);  # Alois P. Heinz, Jan 19 2023
  • Mathematica
    a[n_] := n KroneckerSymbol[-1, n];
    Array[a, 75] (* Jean-François Alcover, Apr 09 2020 *)
  • PARI
    a(n) = n*kronecker(-1, n); \\ Andrew Howroyd, Aug 06 2018

Formula

a(n) = n*Kronecker(-1, n) = n * A034947(n). - Andrew Howroyd, Aug 06 2018

Extensions

More terms from R. J. Mathar, May 14 2007
Keyword:mult added by Andrew Howroyd, Aug 06 2018
New name using existing formula from Joerg Arndt, Jan 19 2023

A379015 a(n) is the reversed non-adjacent form (NAF) representation of n.

Original entry on oeis.org

0, 1, 1, -3, 1, 5, -3, -7, 1, 9, 5, -19, -3, 13, -7, -15, 1, 17, 9, -11, 5, 21, -19, -35, -3, 29, 13, -39, -7, 25, -15, -31, 1, 33, 17, -23, 9, 41, -11, -27, 5, 37, 21, -83, -19, 45, -35, -67, -3, 61, 29, -51, 13, 77, -39, -71, -7, 57, 25, -79, -15, 49, -31, -63
Offset: 0

Views

Author

Darío Clavijo, Dec 13 2024

Keywords

Comments

Fixed points exist when the non-adjacent form is palindromic.

Examples

			For n=7 a(7) = -7 because:
7 to NAF encoding read from least to most significant bit: [-1, 0, 0, 1]
Reversed: [1, 0, 0, -1]
NAF to integer: -7.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Module[{E=n,r=0},While[E>0,If[OddQ[E],Module[{Zi=2-Mod[E,4]},E-=Zi;r+=Zi;]];E=Floor[E/2];r*=2;];Floor[r/2]];Table[a[n],{n,0,63}] (* James C. McMahon, Dec 26 2024 *)
  • PARI
    a(n) = { my (r = 0, d); while (n, if (n%2, d = 2 - (n % 4); r += d; n -= d;); r *= 2; n \= 2;); return (r \ 2); } \\ Rémy Sigrist, Dec 28 2024
  • Python
    def a(n):
        E, r = n, 0
        while E:
            if E & 1:
                Zi = 2 - (E & 3)
                E -= Zi
                r += Zi
            E >>= 1
            r <<= 1
        return r >> 1
    print([a(n) for n in range(0,64)])
    

Formula

a(2^k) = 1.
a(A091072(n)) > 0 iff a(n) is in A016813.
a(A091067(n)) < 0 iff abs(a(n)) is in A004767.

Extensions

a(0) = 0 prepended by Rémy Sigrist, Dec 28 2024

A088023 Set a(1) = 1. Then take the list of defined initial terms, reverse their order, add 1, 2, 3, ... to the reversed list in succession and append this new list to the right of the previously defined terms. Repeat this process indefinitely.

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 5, 5, 6, 7, 8, 8, 8, 9, 9, 9, 10, 11, 12, 12, 13, 14, 14, 14, 14, 15, 16, 16, 16, 17, 17, 17, 18, 19, 20, 20, 21, 22, 22, 22, 23, 24, 25, 25, 25, 26, 26, 26, 26, 27, 28, 28, 29, 30, 30, 30, 30, 31, 32, 32, 32, 33, 33, 33
Offset: 1

Views

Author

Gary W. Adamson, Sep 19 2003

Keywords

Comments

Conjecture: a(n+1) >= a(n). Comments from Don Reble, Nov 13 2005: The conjecture is plainly true. In fact, a(n+1)-a(n) = 0 or 1. Also a(A091072(n)) = n; a(A091072(n)+1) = n+1.

Examples

			The sequence begins 1, 2, then reverse 1, 2 = 2, 1 then add 1, 2 to the latter getting 3, 3. Then append 3, 3, to the right of 1, 2, getting 1, 2, 3, 3. Then repeating the instructions, 1, 2, 3, 3 is reversed then add 1, 2, 3, 4 to 3, 3, 2, 1, = 4, 5, 5, 5. Append the latter to 1, 2, 3, 3 getting 1, 2, 3, 3, 4, 5, 5, 5, ...; and so on.
		

Formula

a(n)=2a(n/2)-1 if a=2^k else a(n)=a(2^k-n+1)+n-2^(k-1) if 2^(k-1)

Extensions

Edited by John W. Layman, Oct 10 2003

A106840 Numbers m such that both m and m+1 have odd part of the form 4*k+1.

Original entry on oeis.org

1, 4, 8, 9, 16, 17, 20, 25, 32, 33, 36, 40, 41, 49, 52, 57, 64, 65, 68, 72, 73, 80, 81, 84, 89, 97, 100, 104, 105, 113, 116, 121, 128, 129, 132, 136, 137, 144, 145, 148, 153, 160, 161, 164, 168, 169, 177, 180, 185, 193, 196, 200, 201, 208, 209, 212, 217, 225
Offset: 1

Author

Ralf Stephan, May 03 2005

Keywords

Comments

From Amiram Eldar, Sep 14 2024: (Start)
Disjoint union of A017077 and {4*A091072(n)}.
The asymptotic density of this sequence is 1/4. (End)

Examples

			20/4 = 5 == 1 (mod 4) and also 21 == 1 (mod 4), therefore 20 is in the sequence.
		

Crossrefs

Contains A106841 and A106841+1.

Programs

  • Mathematica
    f[n_] := Mod[n / 2^IntegerExponent[n, 2] - 1, 4]; SequencePosition[Array[f, 250], {0, 0}][[;;,1]] (* Amiram Eldar, Sep 14 2024 *)

A119973 Numbers of the form (4k+1)*2^j which are not a sum of two squares.

Original entry on oeis.org

21, 33, 42, 57, 66, 69, 77, 84, 93, 105, 114, 129, 132, 133, 138, 141, 154, 161, 165, 168, 177, 186, 189, 201, 209, 210, 213, 217, 228, 237, 249, 253, 258, 264, 266, 273, 276, 282, 285, 297, 301, 308, 309, 321, 322, 329, 330, 336, 341, 345, 354, 357, 372
Offset: 1

Author

Alford Arnold, Jun 03 2006

Keywords

Comments

Intersection of A091072 and A022544. - Robert Israel, Oct 28 2018

Examples

			42 is there because it's (4*5+1)*2^1 and is not a sum of two squares.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local w; w:= n/2^padic:-ordp(n,2);
    w mod 4 = 1 and select(t -> t[2]::odd and t[1] mod 4 = 3, ifactors(w)[2]) <> []
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Oct 28 2018
  • Mathematica
    okQ[n_] := EvenQ[(n/2^IntegerExponent[n, 2]-1)/2] && SquaresR[2, n] == 0;
    Select[Range[1000], okQ] (* Jean-François Alcover, Feb 09 2023 *)

Extensions

More terms from Don Reble, Jul 24 2006

A337821 For n >= 0, a(4n+1) = 0, a(4n+3) = a(2n+1) + 1, a(2n+2) = a(n+1).

Original entry on oeis.org

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

Author

Peter Munn, Sep 23 2020

Keywords

Comments

This sequence is the ruler sequence A007814 interleaved with this sequence; specifically, the odd bisection is A007814, the even bisection is the sequence itself.
The 3-adic valuation of the Doudna sequence (A005940).
The 2-adic valuation of Kimberling's paraphrase (A003602) of the binary number system. [Edited Peter Munn, Aug 13 2025.]

Examples

			Start of table showing the interleaving with ruler sequence, A007814:
   n  a(n)  A007814    a(n/2)
            ((n+1)/2)
   1   0       0
   2   0                 0
   3   1       1
   4   0                 0
   5   0       0
   6   1                 1
   7   2       2
   8   0                 0
   9   0       0
  10   0                 0
  11   1       1
  12   1                 1
  13   0       0
  14   2                 2
  15   3       3
  16   0                 0
  17   0       0
  18   0                 0
  19   1       1
  20   0                 0
  21   0       0
  22   1                 1
  23   2       2
  24   1                 1
		

Crossrefs

Odd bisection: A007814.
A000265, A003602, A005940, A007949 are used in a formula defining this sequence.
Positions of zeros: A091072.
Sequences with similar interleaving: A089309, A014577, A025480, A034947, A038189, A082392, A099545, A181363, A274139.

Programs

  • Mathematica
    a[n_] := IntegerExponent[(n/2^IntegerExponent[n, 2] + 1)/2, 2]; Array[a, 100] (* Amiram Eldar, Sep 30 2020 *)
  • PARI
    a(n) = valuation(n>>valuation(n,2)+1, 2) - 1; \\ Kevin Ryde, Apr 06 2024

Formula

a(2*n) = a(n).
a(2*n+1) = A007814(n+1).
a(n) = A007949(A005940(n)).
a(n) = A007814(A003602(n)) = A007814((A000265(n)+1) / 2) = A089309(n) - 1.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1. - Amiram Eldar, Sep 13 2024

A088742 Run lengths of A088023.

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 1, 3, 3, 1, 1, 2, 1, 4, 1, 3, 3, 1, 1, 2, 1, 3, 1, 1, 3, 4, 1, 2, 1, 4, 1, 3, 3, 1, 1, 2, 1, 3, 1, 1, 3, 3, 1, 1, 2, 1, 4, 1, 3, 4, 1, 2, 1, 3, 1, 1, 3, 4, 1, 2, 1, 4, 1, 3, 3, 1, 1, 2, 1, 3, 1, 1, 3, 3, 1, 1, 2, 1, 4, 1, 3, 3, 1, 1, 2, 1, 3, 1, 1, 3, 4, 1, 2, 1, 4, 1, 3, 4, 1
Offset: 1

Author

Gary W. Adamson, Oct 12 2003

Keywords

Crossrefs

First differences of A091072.

Extensions

More terms and better description from Ralf Stephan, Sep 03 2004
Previous Showing 11-20 of 24 results. Next