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.

User: Dan Asimov

Dan Asimov's wiki page.

Dan Asimov has authored 9 sequences.

A337349 To get a(n), take 3*n+1 and divide out any power of 2; then multiply by 3, subtract 1 and divide out any power of 2.

Original entry on oeis.org

1, 1, 5, 7, 19, 1, 7, 1, 37, 5, 23, 25, 55, 7, 1, 17, 73, 19, 41, 43, 91, 1, 25, 13, 109, 7, 59, 61, 127, 1, 17, 35, 145, 37, 77, 79, 163, 5, 43, 11, 181, 23, 95, 97, 199, 25, 13, 53, 217, 55, 113, 115, 235, 7, 61, 31, 253, 1, 131, 133, 271, 17, 35, 71, 289, 73, 149
Offset: 0

Author

N. J. A. Sloane, based on email from Dan Asimov (dasimov(AT)earthlink.net), Sep 15 2006

Keywords

Comments

When a(x) is iterated, what are the limit cycles? Are there any besides (1) and (17 -> 19 -> 43 -> 97 -> 109 -> 61)?
Up to 1000000000 every number eventually reaches one of those two cycles. In this range, the longest trajectory starts with n=458788881 and takes 193 steps to reach 1. - Christian Boyer (cboyer(AT)club-internet.fr), Sep 16 2006

Crossrefs

Cf. A102421 (bisection), A102423.

Programs

  • Maple
    A337349 := proc(n)
        local a;
        a := 3*n+1;
        while modp(a,2) = 0 do
            a := a/2 ;
        end do:
        a := 3*a-1 ;
        while modp(a,2) = 0 do
            a := a/2 ;
        end do:
        a ;
    end proc: # R. J. Mathar, Aug 24 2020
  • Mathematica
    a[n_] := Module[{k = 3n+1}, k = k/2^IntegerExponent[k, 2]; k = 3k-1; k = k/2^IntegerExponent[k, 2]; k];
    a /@ Range[0, 100] (* Jean-François Alcover, Aug 27 2020 *)

Formula

a(n) = A075677(A067745(n+1)).
a(2*n+1) = A102421(n).

A122563 Start at 2n+1, iterate the map x -> A337349(x); sequence gives the number of iterations to resulting cycle or -1 if the trajectory never cycles.

Original entry on oeis.org

0, 2, 1, 1, 2, 3, 2, 1, 0, 0, 1, 3, 2, 1, 1, 6, 3, 5, 2, 4, 4, 0, 3, 3, 8, 8, 2, 7, 1, 4, 0, 3, 6, 3, 1, 2, 5, 10, 1, 4, 10, 7, 1, 9, 3, 9, 3, 8, 0, 8, 2, 2, 5, 7, 0, 7, 7, 7, 1, 4, 1, 2, 6, 6, 6, 9, 3, 1, 2, 5, 5, 5, 5, 8, 2, 2, 1, 10, 4, 16, 4, 4, 4, 4, 9, 6, 1, 9, 3, 15, 3, 3, 3, 6, 3, 3, 2, 8, 8, 2, 8, 14
Offset: 0

Author

Robert G. Wilson v, based on email from Dan Asimov (dasimov(AT)earthlink.net), Sep 20 2006

Keywords

Comments

Iteration: multiply by 3 and add 1 and divide out any power of 2; then multiply by 3 and subtract 1 and divide out any power of 2.
When a(x) is iterated, what are the limit cycles? Are there any besides {1} and {17 -> 19 -> 43 -> 97 -> 109 -> 61}?

Examples

			The iteration for n=13 is 27->61->17->19->43->97->109->61->... and a(13)=1 step was needed to enter the cycle (at 61).
The iteration for n=30 is 61-> 17->19->43->97->109->61->> and the cycle was already entered at the start, so a(30)=0.
		

Crossrefs

Programs

  • Maple
    A122563 := proc(n)
        local cyc,itr,x ;
        cyc := [] ;
        x := 2*n+1 ;
        while true do
            cyc := [op(cyc),x] ;
            x := A337349(x) ;
            if x in cyc then
                break ;
            end if;
        end do:
        member(x,cyc,'itr') ;
        itr -1 ;
    end proc:
    seq(A122563(n),n=0..101) ; # R. J. Mathar, Aug 26 2020
  • Mathematica
    nextx[x_Integer] := Block[{a = x}, a = 3 a + 1; While[EvenQ@a, a /= 2]; a = 3 a - 1; While[EvenQ@a, a /= 2]; a]; f[n_] := Length@NestWhileList[nextx, n, FreeQ[{1, 17, 19, 43, 97, 109, 61}, #] &] - 1; Table[f[2 n + 1], {n, 0, 101}] (* original program from author corrected as suggested by William P. Orrick, Ray Chandler, Aug 28 2020 *)

Extensions

a(13), a(30),... corrected. - R. J. Mathar, Aug 26 2020

A102423 Start at x=2n+1, iterate the map x -> A337349(x); sequence gives smallest number in the resulting cycle, or -1 if the trajectory never cycles.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 17, 17, 17, 1, 1, 1, 17, 1, 1, 1, 1, 1, 1, 1, 17, 1, 1, 1, 1, 1, 1, 1, 1, 17, 1, 1, 1, 17, 1, 1, 17, 17, 1, 1, 1, 1, 1, 1, 1, 1, 17, 17, 1, 1, 1, 1, 17, 17, 1, 1, 1, 1, 1, 17, 17, 1, 1, 1, 1, 1, 17, 17, 1, 1, 1, 1, 1, 1, 1, 17, 1, 1, 1, 1, 1, 1, 1, 17, 17, 17, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Author

N. J. A. Sloane, based on email from Dan Asimov (dasimov(AT)earthlink.net), Sep 15 2006

Keywords

Comments

See A102421 and A337349 for further comments.

Crossrefs

Cf. A102421, A122563 (iterations to enter cycle), A337349.

Programs

  • Mathematica
    nextx[x_Integer] := Block[{a = x}, a = 3a + 1; While[EvenQ@a, a /= 2]; a = 3a - 1; While[EvenQ@a, a /= 2]; a]; f[n_] := NestWhile[nextx, n, FreeQ[{1, 17, 19, 43, 97, 109, 61}, # ] &]; Table[ If[ f[2n + 1] == 1, 1, 17], {n, 0, 94}] (* Robert G. Wilson v, Sep 20 2006; added 61 to comparison set used for detecting cycles, William P. Orrick, Aug 24 2020; should be "!" prefixing MemberQ, changed to FreeQ, Ray Chandler, Aug 28 2020 *)

Extensions

More terms from Robert G. Wilson v, Sep 20 2006
Replaced A102421 by A337349 in NAME. - R. J. Mathar, Aug 24 2020

A102421 To get a(n), start with 2n+1, multiply by 3 and add 1 and divide out any power of 2; then multiply by 3 and subtract 1 and divide out any power of 2.

Original entry on oeis.org

1, 7, 1, 1, 5, 25, 7, 17, 19, 43, 1, 13, 7, 61, 1, 35, 37, 79, 5, 11, 23, 97, 25, 53, 55, 115, 7, 31, 1, 133, 17, 71, 73, 151, 19, 5, 41, 169, 43, 89, 91, 187, 1, 49, 25, 205, 13, 107, 109, 223, 7, 29, 59, 241, 61, 125, 127, 259, 1, 67, 17, 277, 35, 143, 145, 295, 37, 19, 77, 313
Offset: 0

Author

N. J. A. Sloane, based on email from Dan Asimov (dasimov(AT)earthlink.net), Sep 15 2006

Keywords

Comments

"Start with 2n+1, multiply by 3 and add 1 and divide out any power of 2;" is "equivalent to Start with 3n+2, divide out any power of 2;" - David A. Corneth, Aug 22 2020

Examples

			n=1, 2n+1 = 3 -> 10 -> 5; 5 -> 14 ->7 = a(1).
n=17, 2*n+1 = 35 -> 106 ->53; 53 -> 158 -> 79 = a(17).
		

Crossrefs

Programs

  • Maple
    A102421 :=proc(n) local j; j:=3*n+1; while j mod 2 = 0 do j:=j/2; od: j:=3*j-1; while j mod 2 = 0 do j:=j/2; od: j; end proc;
  • Mathematica
    nextx[x_Integer] := Block[{ a = x}, a = 3a + 1; While[EvenQ@a, a /= 2]; a = 3a - 1; While[EvenQ@a, a /= 2]; a]; Table[ nextx[2n + 1], {n, 0, 69}] (* Robert G. Wilson v Sep 20 2006 *)
  • PARI
    a(n) = {n = 3*n + 2; n>>=valuation(n, 2); n = 3*n - 1; n >> valuation(n, 2)} \\ David A. Corneth, Aug 22 2020

Formula

a(n) = A337349(2*n+1). - R. J. Mathar, Aug 24 2020

Extensions

Moved comments to A337349. - R. J. Mathar, Aug 24 2020

A070066 Values of y in positive integer solutions of x^2 + y^5 = z^3, listed in increasing order of z. (If a z-value occurs twice, list solutions in increasing order of y.)

Original entry on oeis.org

3, 9, 16, 16, 32, 48, 24, 6, 55, 72, 72, 100, 72, 112, 72, 108, 144, 162, 36, 192, 72, 100, 216, 72, 295, 343, 351, 359, 72, 368, 423, 343, 216, 300, 343, 648, 800, 783, 625, 833, 400, 450, 648, 972, 496, 576, 1024, 864, 675, 972, 1215, 242, 72, 500, 1176
Offset: 1

Author

Dean Hickerson and Dan Asimov (asimov(AT)msri.org), Apr 18 2002

Keywords

Examples

			The first 5 solutions are (x,y,z) = (10,3,7), (1242,9,117), (1024,16,128), (5632,16,320) and (20480,32,768).
		

Crossrefs

x-values are in A070065, z-values are in A070067.

Programs

  • Mathematica
    For[z=1, True, z++, z3=z^3; For[y=1, (d=z3-y^5)>0, y++, If[IntegerQ[x=Sqrt[d]], Print[{x, y, z}]]]]

A070067 Values of z in positive integer solutions of x^2 + y^5 = z^3, listed in increasing order of z.

Original entry on oeis.org

7, 117, 128, 320, 768, 832, 1120, 1153, 1226, 1296, 1377, 2500, 2592, 2816, 3168, 3888, 5760, 6561, 6948, 7168, 7776, 10625, 12960, 13968, 16514, 19208, 19926, 20240, 23652, 24384, 29158, 33614, 42768, 60100, 67228, 69984, 70400, 71199
Offset: 1

Author

Dean Hickerson and Dan Asimov (asimov(AT)msri.org), Apr 18 2002

Keywords

Examples

			The first 5 solutions are (x,y,z) = (10,3,7), (1242,9,117), (1024,16,128), (5632,16,320) and (20480,32,768).
		

Crossrefs

x-values are in A070065, y-values are in A070066.

Programs

  • Mathematica
    For[z=1, True, z++, z3=z^3; For[y=1, (d=z3-y^5)>0, y++, If[IntegerQ[x=Sqrt[d]], Print[{x, y, z}]]]]

A070065 Values of x in positive integer solutions of x^2 + y^5 = z^3, listed in increasing order of z. (If a z-value occurs twice, list solutions in increasing order of y.)

Original entry on oeis.org

10, 1242, 1024, 5632, 20480, 17920, 37376, 39151, 36599, 15552, 26001, 75000, 124416, 68608, 172800, 209952, 359424, 413343, 579096, 327680, 684288, 1090625, 1306368, 1650240, 1506463, 1529437, 1607445, 1525899, 3637224, 2783744
Offset: 1

Author

Dean Hickerson and Dan Asimov (asimov(AT)msri.org), Apr 18 2002

Keywords

Comments

If x is in the sequence, then so is c^15 x for positive integers c, since if (x,y,z) is a solution, so is (c^15 x, c^6 y, c^10 z). - Robert Israel, Jul 26 2017

Examples

			The first 5 solutions are (x,y,z) = (10,3,7), (1242,9,117), (1024,16,128), (5632,16,320) and (20480,32,768).
		

Crossrefs

y-values are in A070066, z-values are in A070067.

Programs

  • Mathematica
    For[z=1, True, z++, z3=z^3; For[y=1, (d=z3-y^5)>0, y++, If[IntegerQ[x=Sqrt[d]], Print[{x, y, z}]]]]

A053726 "Flag numbers": number of dots that can be arranged in successive rows of K, K-1, K, K-1, K, ..., K-1, K (assuming there is a total of L > 1 rows of size K > 1).

Original entry on oeis.org

5, 8, 11, 13, 14, 17, 18, 20, 23, 25, 26, 28, 29, 32, 33, 35, 38, 39, 41, 43, 44, 46, 47, 48, 50, 53, 56, 58, 59, 60, 61, 62, 63, 65, 67, 68, 71, 72, 73, 74, 77, 78, 80, 81, 83, 85, 86, 88, 89, 92, 93, 94, 95, 98, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 113, 116
Offset: 1

Author

Dan Asimov, asimovd(AT)aol.com, Apr 09 2003

Keywords

Comments

Numbers of the form F(K, L) = KL+(K-1)(L-1), K, L > 1, i.e. 2KL - (K+L) + 1, sorted and duplicates removed.
If K=1, L=1 were allowed, this would contain all positive integers.
Positive numbers > 1 but not of the form (odd primes plus one)/2. - Douglas Winston (douglas.winston(AT)srupc.com), Sep 11 2003
In other words, numbers n such that 2n-1, or equally, A064216(n) is a composite number. - Antti Karttunen, Apr 17 2015
Note: the following comment was originally applied in error to the numerically similar A246371. - Allan C. Wechsler, Aug 01 2022
From Matthijs Coster, Dec 22 2014: (Start)
Also area of (over 45 degree) rotated rectangles with sides > 1. The area of such rectangles is 2ab - a - b + 1 = 1/2((2a-1)(2b-1)+1).
Example: Here a = 3 and b = 5. The area = 23.
*
***
*****
*****
*****
***
*
(End)
The smallest integer > k/2 and coprime to k, where k is the n-th odd composite number. - Mike Jones, Jul 22 2024
Numbers k such that A193773(k-1) > 1. - Allan C. Wechsler, Oct 22 2024

Crossrefs

Essentially same as A104275, but without the initial one.
A144650 sorted into ascending order, with duplicates removes.
Cf. A006254 (complement, apart from 1, which is in neither sequence).
Differs from its subsequence A246371 for the first time at a(8) = 20, which is missing from A246371.

Programs

  • PARI
    select( {is_A053726(n)=n>4 && !isprime(n*2-1)}, [1..115]) \\ M. F. Hasler, Aug 02 2022
  • Python
    from sympy import isprime
    def ok(n): return n > 1 and not isprime(2*n-1)
    print(list(filter(ok, range(1, 117)))) # Michael S. Branicky, May 08 2021
    
  • Python
    from sympy import primepi
    def A053726(n):
        if n == 1: return 5
        m, k = n, (r:=primepi(n)) + n + (n>>1)
        while m != k:
            m, k = k, (r:=primepi(k)) + n + (k>>1)
        return r+n # Chai Wah Wu, Aug 02 2024
    
  • Scheme
    ;; with Antti Karttunen's IntSeq-library.
    (define A053726 (MATCHING-POS 1 1 (lambda (n) (and (> n 1) (not (prime? (+ n n -1)))))))
    ;; Antti Karttunen, Apr 17 2015
    
  • Scheme
    ;; with Antti Karttunen's IntSeq-library.
    (define (A053726 n) (+ n (A000720 (A071904 n))))
    ;; Antti Karttunen, Apr 17 2015
    

Formula

a(n) = A008508(n) + n + 1.
From Antti Karttunen, Apr 17 2015: (Start)
a(n) = n + A000720(A071904(n)). [The above formula reduces to this. A000720(k) gives number of primes <= k, and A071904 gives the n-th odd composite number.]
a(n) = A104275(n+1). (End)
a(n) = A116922(A071904(n)). - Mike Jones, Jul 22 2024
a(n) = A047845(n+1)+1. - Amiram Eldar, Jul 30 2024

Extensions

More terms from Douglas Winston (douglas.winston(AT)srupc.com), Sep 11 2003

A028260 Numbers with an even number of prime divisors (counted with multiplicity); numbers k such that the Liouville function lambda(k) (A008836) is positive.

Original entry on oeis.org

1, 4, 6, 9, 10, 14, 15, 16, 21, 22, 24, 25, 26, 33, 34, 35, 36, 38, 39, 40, 46, 49, 51, 54, 55, 56, 57, 58, 60, 62, 64, 65, 69, 74, 77, 81, 82, 84, 85, 86, 87, 88, 90, 91, 93, 94, 95, 96, 100, 104, 106, 111, 115, 118, 119, 121, 122, 123, 126, 129, 132, 133, 134
Offset: 1

Author

Dan Asimov (dan(AT)research.att.com)

Keywords

Comments

If k appears, p*k does not (p primes). - Philippe Deléham, Jun 10 2006
The product of any two terms of this sequence, or any two terms of the complement of this sequence (A026424), is a term of this sequence. The product of a term of this sequence and a term of A026424 is a term of A026424. The primitive terms of this sequence are the semiprimes (A001358). - Franklin T. Adams-Watters, Nov 27 2006
A072978 is a subsequence. - Reinhard Zumkeller, Sep 20 2008
Quadratic residues of A191089(n) as n -> oo. - Travis Scott, Jan 14 2023

Crossrefs

Cf. A001222, A001358, A008836, A026424 (complement), A145784, A065043 (char. func).

Programs

  • Haskell
    a028260 n = a028260_list !! (n-1)
    a028260_list = filter (even . a001222) [1..]
    -- Reinhard Zumkeller, Oct 05 2011
    
  • Maple
    with(numtheory); A028260 := proc(n) option remember: local k: if(n=1)then return 1: fi: for k from procname(n-1)+1 do if(bigomega(k) mod 2=0)then return k: fi: od: end: seq(A028260(n),n=1..63); # Nathaniel Johnston, May 27 2011
  • Mathematica
    Select[Range[200],EvenQ[PrimeOmega[#]]&] (* Harvey P. Dale, Aug 14 2011 *)
    Select[Range@ 134, LiouvilleLambda@# > 0 &] (* Robert G. Wilson v, Jul 06 2012 *)
  • PARI
    is(n)=bigomega(n)%2==0 \\ Charles R Greathouse IV, May 29 2013
    
  • Python
    from math import isqrt, prod
    from sympy import primerange, primepi, integer_nthroot
    def A028260(n):
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b,isqrt(x//c)+1),a)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b,integer_nthroot(x//c,m)[0]+1),a) for d in g(x,a2,b2,c*b2,m-1)))
        def f(x): return int(n+x-1-sum(sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,m)) for m in range(2,x.bit_length()+1,2)))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Apr 10 2025

Formula

A066829(a(n)) = 0. - Reinhard Zumkeller, Jun 26 2009
A001222(a(n)) mod 2 = 0. - Reinhard Zumkeller, Oct 05 2011
Sum_{n>=1} 1/a(n)^s = (zeta(s)^2 + zeta(2*s))/(2*zeta(s)). - Enrique Pérez Herrero, Jul 06 2012