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-10 of 20 results. Next

A163511 a(0)=1. a(n) = p(A000120(n)) * Product_{m=1..A000120(n)} p(m)^A163510(n,m), where p(m) is the m-th prime.

Original entry on oeis.org

1, 2, 4, 3, 8, 9, 6, 5, 16, 27, 18, 25, 12, 15, 10, 7, 32, 81, 54, 125, 36, 75, 50, 49, 24, 45, 30, 35, 20, 21, 14, 11, 64, 243, 162, 625, 108, 375, 250, 343, 72, 225, 150, 245, 100, 147, 98, 121, 48, 135, 90, 175, 60, 105, 70, 77, 40, 63, 42, 55, 28, 33, 22, 13, 128
Offset: 0

Views

Author

Leroy Quet, Jul 29 2009

Keywords

Comments

This is a permutation of the positive integers.
From Antti Karttunen, Jun 20 2014: (Start)
Note the indexing: the domain starts from 0, while the range excludes zero, thus this is neither a bijection on the set of nonnegative integers nor on the set of positive natural numbers, but a bijection from the former set to the latter.
Apart from that discrepancy, this could be viewed as yet another "entanglement permutation" where the two complementary pairs to be interwoven together are even and odd numbers (A005843/A005408) which are entangled with the complementary pair even numbers (taken straight) and odd numbers in the order they appear in A003961: (A005843/A003961). See also A246375 which has almost the same recurrence.
Note how the even bisection halved gives the same sequence back. (For a(0)=1, take ceiling of 1/2).
(End)
From Antti Karttunen, Dec 30 2017: (Start)
This irregular table can be represented as a binary tree. Each child to the left is obtained by doubling the parent, and each child to the right is obtained by applying A003961 to the parent:
1
|
...................2...................
4 3
8......../ \........9 6......../ \........5
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
16 27 18 25 12 15 10 7
32 81 54 125 36 75 50 49 24 45 30 35 20 21 14 11
etc.
Sequence A005940 is obtained by scanning the same tree level by level in mirror image fashion. Also in binary trees A253563 and A253565 the terms on level of the tree are some permutation of the terms present on the level n of this tree. A252464(n) gives the distance of n from 1 in all these trees, and A252463 gives the parent of the node containing n.
A252737(n) gives the sum and A252738(n) the product of terms on row n (where 1 is on row 0, 1 on row 1, 3 and 4 on row 2, etc.). A252745(n) gives the number of nodes on level n whose left child is smaller than the right child, and A252744(n) is an indicator function for those nodes.
(End)
Note that the idea behind maps like this (and the mirror image A005940) admits also using alternative orderings of primes, not just standard magnitude-wise ordering (A000040). For example, A332214 is a similar sequence but with primes rearranged as in A332211, and A332817 is obtained when primes are rearranged as in A108546. - Antti Karttunen, Mar 11 2020
From Lorenzo Sauras Altuzarra, Nov 28 2020: (Start)
This sequence is generated from A228351 by applying the following procedure: 1) eliminate the compositions that end in one unless the first one, 2) subtract one unit from every component, 3) replace every tuple [t_1, ..., t_r] by Product_{k=1..r} A000040(k)^(t_k) (see the examples).
Is it true that a(n) = A337909(n+1) if and only if a(n+1) is not a term of A161992?
Does this permutation have any other cycle apart from (1), (2) and (6, 9, 16, 7)? (End)
From Antti Karttunen, Jul 25 2023: (Start)
(In the above question, it is assumed that the starting offset would be 1 instead of 0).
Questions:
Does a(n) = 1+A054429(n) hold only when n is of the form 2^k times 1, 3 or 7, i.e., one of the terms of A029748?
It seems that A007283 gives all fixed points of map n -> a(n), like A335431 seems to give all fixed points of map n -> A332214(n). Is there a general rule for mappings like these that the fixed points (if they exist) must be of the form 2^k times a certain kind of prime, i.e., that any odd composite (times 2^k) can certainly be excluded? See also note in A029747.
(End)
If the conjecture given in A364297 holds, then it implies the above conjecture about A007283. See also A364963. - Antti Karttunen, Sep 06 2023
Conjecture: a(n^k) is never of the form x^k, for any integers n > 0, k > 1, x >= 1. This holds at least for squares, cubes, seventh and eleventh powers (see A365808, A365801, A366287 and A366391). - Antti Karttunen, Sep 24 2023, Oct 10 2023.
See A365805 for why the above holds for any n^k, with k > 1. - Antti Karttunen, Nov 23 2023

Examples

			For n=3, whose binary representation is "11", we have A000120(3)=2, with A163510(3,1) = A163510(3,2) = 0, thus a(3) = p(2) * p(1)^0 * p(2)^0 = 3*1*1 = 3.
For n=9, "1001" in binary, we have A000120(9)=2, with A163510(9,1) = 0 and A163510(9,2) = 2, thus a(9) = p(2) * p(1)^0 * p(2)^2 = 3*1*9 = 27.
For n=10, "1010" in binary, we have A000120(10)=2, with A163510(10,1) = 1 and A163510(10,2) = 1, thus a(10) = p(2) * p(1)^1 * p(2)^1 = 3*2*3 = 18.
For n=15, "1111" in binary, we have A000120(15)=4, with A163510(15,1) = A163510(15,2) = A163510(15,3) = A163510(15,4) = 0, thus a(15) = p(4) * p(1)^0 * p(2)^0 * p(3)^0 * p(4)^0 = 7*1*1*1*1 = 7.
[1], [2], [1,1], [3], [1,2], [2,1] ... -> [1], [2], [3], [1,2], ... -> [0], [1], [2], [0,1], ... -> 2^0, 2^1, 2^2, 2^0*3^1, ... = 1, 2, 4, 3, ... - _Lorenzo Sauras Altuzarra_, Nov 28 2020
		

Crossrefs

Inverse: A243071.
Cf. A007283 (known positions where a(n)=n), A029747, A029748, A364255 [= gcd(n,a(n))], A364258 [= a(n)-n], A364287 (where a(n) < n), A364292 (where a(n) <= n), A364494 (where n|a(n)), A364496 (where a(n)|n), A364963, A364297.
Cf. A365808 (positions of squares), A365801 (of cubes), A365802 (of fifth powers), A365805 [= A052409(a(n))], A366287, A366391.
Cf. A005940, A332214, A332817, A366275 (variants).

Programs

  • Mathematica
    f[n_] := Reverse@ Map[Ceiling[(Length@ # - 1)/2] &, DeleteCases[Split@ Join[Riffle[IntegerDigits[n, 2], 0], {0}], {k__} /; k == 1]]; {1}~Join~
    Table[Function[t, Prime[t] Product[Prime[m]^(f[n][[m]]), {m, t}]][DigitCount[n, 2, 1]], {n, 120}] (* Michael De Vlieger, Jul 25 2016 *)
  • Python
    from sympy import prime
    def A163511(n):
        if n:
            k, c, m = n, 0, 1
            while k:
                c += 1
                m *= prime(c)**(s:=(~k&k-1).bit_length())
                k >>= s+1
            return m*prime(c)
        return 1 # Chai Wah Wu, Jul 17 2023

Formula

For n >= 1, a(2n) is even, a(2n+1) is odd. a(2^k) = 2^(k+1), for all k >= 0.
From Antti Karttunen, Jun 20 2014: (Start)
a(0) = 1, a(1) = 2, a(2n) = 2*a(n), a(2n+1) = A003961(a(n)).
As a more general observation about the parity, we have:
For n >= 1, A007814(a(n)) = A135523(n) = A007814(n) + A209229(n). [This permutation preserves the 2-adic valuation of n, except when n is a power of two, in which cases that value is incremented by one.]
For n >= 1, A055396(a(n)) = A091090(n) = A007814(n+1) + 1 - A036987(n).
For n >= 1, a(A000225(n)) = A000040(n).
(End)
From Antti Karttunen, Oct 11 2014: (Start)
As a composition of related permutations:
a(n) = A005940(1+A054429(n)).
a(n) = A064216(A245612(n))
a(n) = A246681(A246378(n)).
Also, for all n >= 0, it holds that:
A161511(n) = A243503(a(n)).
A243499(n) = A243504(a(n)).
(End)
More linking identities from Antti Karttunen, Dec 30 2017: (Start)
A046523(a(n)) = A278531(n). [See also A286531.]
A278224(a(n)) = A285713(n). [Another filter-sequence.]
A048675(a(n)) = A135529(n) seems to hold for n >= 1.
A250245(a(n)) = A252755(n).
A252742(a(n)) = A252744(n).
A245611(a(n)) = A253891(n).
A249824(a(n)) = A275716(n).
A292263(a(n)) = A292264(n). [A292944(n) + A292264(n) = n.]
--
A292383(a(n)) = A292274(n).
A292385(a(n)) = A292271(n). [A292271(n) + A292274(n) = n.]
--
A292941(a(n)) = A292942(n).
A292943(a(n)) = A292944(n).
A292945(a(n)) = A292946(n). [A292942(n) + A292944(n) + A292946(n) = n.]
--
A292253(a(n)) = A292254(n).
A292255(a(n)) = A292256(n). [A292944(n) + A292254(n) + A292256(n) = n.]
--
A279339(a(n)) = A279342(n).
a(A071574(n)) = A269847(n).
a(A279341(n)) = A279338(n).
a(A252756(n)) = A250246(n).
(1+A008836(a(n)))/2 = A059448(n).
(End)
From Antti Karttunen, Jul 26 2023: (Start)
For all n >= 0, a(A007283(n)) = A007283(n).
A001222(a(n)) = A290251(n).
(End)

Extensions

More terms computed and examples added by Antti Karttunen, Jun 20 2014

A023758 Numbers of the form 2^i - 2^j with i >= j.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 28, 30, 31, 32, 48, 56, 60, 62, 63, 64, 96, 112, 120, 124, 126, 127, 128, 192, 224, 240, 248, 252, 254, 255, 256, 384, 448, 480, 496, 504, 508, 510, 511, 512, 768, 896, 960, 992, 1008, 1016, 1020, 1022, 1023
Offset: 1

Views

Author

Keywords

Comments

Numbers whose digits in base 2 are in nonincreasing order.
Might be called "nialpdromes".
Subset of A077436. Proof: Since a(n) is of the form (2^i-1)*2^j, i,j >= 0, a(n)^2 = (2^(2i) - 2^(i+1))*2^(2j) + 2^(2j) where the first sum term has i-1 one bits and its 2j-th bit is zero, while the second sum term switches the 2j-th bit to one, giving i one bits, as in a(n). - Ralf Stephan, Mar 08 2004
Numbers whose binary representation contains no "01". - Benoit Cloitre, May 23 2004
Every polynomial with coefficients equal to 1 for the leading terms and 0 after that, evaluated at 2. For instance a(13) = x^4 + x^3 + x^2 at 2, a(14) = x^4 + x^3 + x^2 + x at 2. - Ben Paul Thurston, Jan 11 2008
From Gary W. Adamson, Jul 18 2008: (Start)
As a triangle by rows starting:
1;
2, 3;
4, 6, 7;
8, 12, 14, 15;
16, 24, 28, 30, 31;
...,
equals A000012 * A130123 * A000012, where A130123 = (1, 0,2; 0,0,4; 0,0,0,8; ...). Row sums of this triangle = A000337 starting (1, 5, 17, 49, 129, ...). (End)
First differences are A057728 = 1; 1; 1; 1; 2,1; 1; 4,2,1; 1; 8,4,2,1; 1; ... i.e., decreasing powers of 2, separated by another "1". - M. F. Hasler, May 06 2009
Apart from first term, numbers that are powers of 2 or the sum of some consecutive powers of 2. - Omar E. Pol, Feb 14 2013
From Andres Cicuttin, Apr 29 2016: (Start)
Numbers that can be digitally generated with twisted ring (Johnson) counters. This is, the binary digits of a(n) correspond to those stored in a shift register where the input bit of the first bit storage element is the inverted output of the last storage element. After starting with all 0’s, each new state is obtained by rotating the stored bits but inverting at each state transition the last bit that goes to the first position (see link).
Examples: for a(n) represented by three bits
Binary
a(5)= 4 -> 100 last bit = 0
a(6)= 6 -> 110 first bit = 1 (inverted last bit of previous number)
a(7)= 7 -> 111
and for a(n) represented by four bits
Binary
a(8) = 8 -> 1000
a(9) = 12 -> 1100 last bit = 0
a(10)= 14 -> 1110 first bit = 1 (inverted last bit of previous number)
a(11)= 15 -> 1111
(End)
Powers of 2 represented in bases which are terms of this sequence must always contain at least one digit which is also a power of 2. This is because 2^i mod (2^i - 2^j) = 2^j, which means the last digit always cycles through powers of 2 (or if i=j+1 then the first digit is a power of 2 and the rest are trailing zeros). The only known non-member of this sequence with this property is 5. - Ely Golden, Sep 05 2017
Numbers k such that k = 2^(1 + A000523(k)) - 2^A007814(k). - Daniel Starodubtsev, Aug 05 2021
A002260(n) = v(a(n)/2^v(a(n))+1) and A002024(n) = A002260(n) + v(a(n)) where v is the dyadic valuation (i.e., A007814). - Lorenzo Sauras Altuzarra, Feb 01 2023

Examples

			a(22) = 64 = 32 + 32 = 2^5 + a(16) = 2^A003056(20) + a(22-5-1).
a(23) = 96 = 64 + 32 = 2^6 + a(16) = 2^A003056(21) + a(23-6-1).
a(24) = 112 = 64 + 48 = 2^6 + a(17) = 2^A003056(22) + a(24-6-1).
		

Crossrefs

A000337(r) = sum of row T(r, c) with 0 <= c < r. See also A002024, A003056, A140129, A140130, A221975.
Cf. A007088, A130123, A101082 (complement), A340375 (characteristic function).
This is the base-2 version of A064222. First differences are A057728.
Subsequence of A077436, of A129523, of A277704, and of A333762.
Subsequences: A043569 (nonzero even terms, or equally, nonzero terms doubled), A175332, A272615, A335431, A000396 (its even terms only), A324200.
Positions of zeros in A049502, A265397, A277899, A284264.
Positions of ones in A283983, A283989.
Positions of nonzero terms in A341509 (apart from the initial zero).
Positions of squarefree terms in A260443.
Fixed points of A264977, A277711, A283165, A334666.
Distinct terms in A340632.
Cf. also A309758, A309759, A309761 (for analogous sequences).

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a023758 n = a023758_list !! (n-1)
    a023758_list = 0 : f (singleton 1) where
    f s = x : f (if even x then insert z s' else insert z $ insert (z+1) s')
    where z = 2*x; (x, s') = deleteFindMin s
    -- Reinhard Zumkeller, Sep 24 2014, Dec 19 2012
    
  • Maple
    a:=proc(n) local n2,d: n2:=convert(n,base,2): d:={seq(n2[j]-n2[j-1],j=2..nops(n2))}: if n=0 then 0 elif n=1 then 1 elif d={0,1} or d={0} or d={1} then n else fi end: seq(a(n),n=0..2100); # Emeric Deutsch, Apr 22 2006
  • Mathematica
    Union[Flatten[Table[2^i - 2^j, {i, 0, 100}, {j, 0, i}]]] (* T. D. Noe, Mar 15 2011 *)
    Select[Range[0, 2^10], NoneTrue[Differences@ IntegerDigits[#, 2], # > 0 &] &] (* Michael De Vlieger, Sep 05 2017 *)
  • PARI
    for(n=0,2500,if(prod(k=1,length(binary(n))-1,component(binary(n),k)+1-component(binary(n),k+1))>0,print1(n,",")))
    
  • PARI
    A023758(n)= my(r=round(sqrt(2*n--))); (1<<(n-r*(r-1)/2)-1)<<(r*(r+1)/2-n)
    /* or, to illustrate the "decreasing digit" property and analogy to A064222: */
    A023758(n,show=0)={ my(a=0); while(n--, show & print1(a","); a=vecsort(binary(a+1)); a*=vector(#a,j,2^(j-1))~); a} \\ M. F. Hasler, May 06 2009
    
  • PARI
    is(n)=if(n<5,1,n>>=valuation(n,2);n++;n>>valuation(n,2)==1) \\ Charles R Greathouse IV, Jan 04 2016
    
  • PARI
    list(lim)=my(v=List([0]),t); for(i=1,logint(lim\1+1,2), t=2^i-1; while(t<=lim, listput(v,t); t*=2)); Set(v) \\ Charles R Greathouse IV, May 03 2016
    
  • Python
    def a_next(a_n): return (a_n | (a_n >> 1)) + (a_n & 1)
    a_n = 1; a = [0]
    for i in range(55): a.append(a_n); a_n = a_next(a_n) # Falk Hüffner, Feb 19 2022
    
  • Python
    from math import isqrt
    def A023758(n): return (1<<(m:=isqrt(n-1<<3)+1>>1))-(1<<(m*(m+1)-(n-1<<1)>>1)) # Chai Wah Wu, Feb 23 2025

Formula

a(n) = 2^s(n) - 2^((s(n)^2 + s(n) - 2n)/2) where s(n) = ceiling((-1 + sqrt(1+8n))/2). - Sam Alexander, Jan 08 2005
a(n) = 2^k + a(n-k-1) for 1 < n and k = A003056(n-2). The rows of T(r, c) = 2^r-2^c for 0 <= c < r read from right to left produce this sequence: 1; 2, 3; 4, 6, 7; 8, 12, 14, 15; ... - Frank Ellermann, Dec 06 2001
For n > 0, a(n) mod 2 = A010054(n). - Benoit Cloitre, May 23 2004
A140130(a(n)) = 1 and for n > 1: A140129(a(n)) = A002262(n-2). - Reinhard Zumkeller, May 14 2008
a(n+1) = (2^(n - r(r-1)/2) - 1) 2^(r(r+1)/2 - n), where r=round(sqrt(2n)). - M. F. Hasler, May 06 2009
Start with A000225. If k is in the sequence, then so is 2k. - Ralf Stephan, Aug 16 2013
G.f.: (x^2/((2-x)*(1-x)))*(1 + Sum_{k>=0} x^((k^2+k)/2)*(1 + x*(2^k-1))). The sum is related to Jacobi theta functions. - Robert Israel, Feb 24 2015
A049502(a(n)) = 0. - Reinhard Zumkeller, Jun 17 2015
a(n) = a(n-1) + a(n-d)/a(d*(d+1)/2 + 2) if n > 1, d > 0, where d = A002262(n-2). - Yuchun Ji, May 11 2020
A277699(a(n)) = a(n)^2, A306441(a(n)) = a(n+1). - Antti Karttunen, Feb 15 2021 (the latter identity from A306441)
Sum_{n>=2} 1/a(n) = A211705. - Amiram Eldar, Feb 20 2022

Extensions

Definition changed by N. J. A. Sloane, Jan 05 2008

A331410 a(n) is the number of iterations needed to reach a power of 2 starting at n and using the map k -> k + k/p, where p is the largest prime factor of k.

Original entry on oeis.org

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

Views

Author

Ali Sada, Jan 16 2020

Keywords

Comments

Let f(n) = A000265(n) be the odd part of n. Let p be the largest prime factor of k, and say k = p * m. Suppose that k is not a power of 2, i.e., p > 2, then f(k) = p * f(m). The iteration is k -> k + k/p = p*m + m = (p+1) * m. So, p * f(m) -> f(p+1) * f(m). Since for p > 2, f(p+1) < p, the odd part in each iteration decreases, until it becomes 1, i.e., until we reach a power of 2. - Amiram Eldar, Feb 19 2020
Any odd prime factor of k can be used at any step of the iteration, and the result will be same. Thus, like A329697, this is also fully additive sequence. - Antti Karttunen, Apr 29 2020
If and only if a(n) is equal to A005087(n), then sigma(2n) - sigma(n) is a power of 2. (See A336923, A046528). - Antti Karttunen, Mar 16 2021

Examples

			The trajectory of 15 is [15,18,24,32], taking 3 iterations to reach 32. So, a(15) = 3.
		

Crossrefs

Cf. A000265, A005087, A006530 (greatest prime factor), A052126, A078701, A087436, A329662 (positions of records and the first occurrences of each n), A334097, A334098, A334108, A334861, A336467, A336921, A336922, A336923 (A046528).
Cf. array A335430, and its rows A335431, A335882, and also A335874.
Cf. also A329697 (analogous sequence when using the map k -> k - k/p), A335878.
Cf. also A330437, A335884, A335885, A336362, A336363 for other similar iterations.

Programs

  • Magma
    f:=func; g:=func; a:=[]; for n in [1..1000] do k:=n; s:=0; while not g(k) do  s:=s+1; k:=f(k); end while; Append(~a,s); end for; a; // Marius A. Burtea, Jan 19 2020
    
  • Mathematica
    a[n_] := -1 + Length @ NestWhileList[# + #/FactorInteger[#][[-1, 1]] &, n, # / 2^IntegerExponent[#, 2] != 1 &]; Array[a, 100] (* Amiram Eldar, Jan 16 2020 *)
  • PARI
    A331410(n) = if(!bitand(n,n-1),0,1+A331410(n+(n/vecmax(factor(n)[, 1])))); \\ Antti Karttunen, Apr 29 2020
    
  • PARI
    A331410(n) = { my(k=0); while(bitand(n,n-1), k++; my(f=factor(n)[, 1]); n += (n/f[2-(n%2)])); (k); }; \\ Antti Karttunen, Apr 29 2020
    
  • PARI
    A331410(n) = { my(f=factor(n)); sum(k=1,#f~,if(2==f[k,1],0,f[k,2]*(1+A331410(1+f[k,1])))); }; \\ Antti Karttunen, Apr 30 2020

Formula

From Antti Karttunen, Apr 29 2020: (Start)
This is a completely additive sequence: a(2) = 0, a(p) = 1+a(p+1) for odd primes p, a(m*n) = a(m)+a(n), if m,n > 1.
a(2n) = a(A000265(n)) = a(n).
If A209229(n) == 1, a(n) = 0, otherwise a(n) = 1 + a(n+A052126(n)), or equally, 1 + a(n+(n/A078701(n))).
a(n) = A334097(n) - A334098(n).
a(A122111(n)) = A334108(n).
(End)
a(n) = A334861(n) - A329697(n). - Antti Karttunen, May 14 2020
a(n) = a(A336467(n)) + A087436(n) = A336921(n) + A087436(n). - Antti Karttunen, Mar 16 2021

Extensions

Data section extended up to a(105) by Antti Karttunen, Apr 29 2020

A029747 Numbers of the form 2^k times 1, 3 or 5.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128, 160, 192, 256, 320, 384, 512, 640, 768, 1024, 1280, 1536, 2048, 2560, 3072, 4096, 5120, 6144, 8192, 10240, 12288, 16384, 20480, 24576, 32768, 40960, 49152, 65536, 81920, 98304, 131072, 163840, 196608
Offset: 1

Views

Author

Keywords

Comments

Fixed points of the Doudna sequence: A005940(a(n)) = A005941(a(n)) = a(n). - Reinhard Zumkeller, Aug 23 2006
Subsequence of A103969. - R. J. Mathar, Mar 06 2010
Question: Is there a simple proof that A005940(c) = c would never allow an odd composite c as a solution? See also my comments in A163511 and in A335431 concerning similar problems, also A364551 and A364576. - Antti Karttunen, Jul 28 & Aug 11 2023

Examples

			128 = 2^7 * 1 is in the sequence as well as 160 = 2^5 * 5. - _David A. Corneth_, Sep 18 2020
		

Crossrefs

Subsequence of the following sequences: A103969, A253789, A364541, A364542, A364544, A364546, A364548, A364550, A364560, A364565.
Even terms form a subsequence of A320674.

Programs

  • Mathematica
    m = 200000; Select[Union @ Flatten @ Outer[Times, {1, 3, 5}, 2^Range[0, Floor[Log2[m]]]], # < m &] (* Amiram Eldar, Oct 15 2020 *)
  • PARI
    is(n) = n>>valuation(n, 2) <= 5 \\ David A. Corneth, Sep 18 2020
    
  • Python
    def A029747(n):
        if n<3: return n
        a, b = divmod(n,3)
        return 1<Chai Wah Wu, Apr 02 2025

Formula

a(n) = if n < 6 then n else 2*a(n-3). - Reinhard Zumkeller, Aug 23 2006
G.f.: (1+x+x^2)^2/(1-2*x^3). - R. J. Mathar, Mar 06 2010
Sum_{n>=1} 1/a(n) = 46/15. - Amiram Eldar, Oct 15 2020

Extensions

Edited by David A. Corneth and Peter Munn, Sep 18 2020

A038550 Products of an odd prime and a power of two (sorted).

Original entry on oeis.org

3, 5, 6, 7, 10, 11, 12, 13, 14, 17, 19, 20, 22, 23, 24, 26, 28, 29, 31, 34, 37, 38, 40, 41, 43, 44, 46, 47, 48, 52, 53, 56, 58, 59, 61, 62, 67, 68, 71, 73, 74, 76, 79, 80, 82, 83, 86, 88, 89, 92, 94, 96, 97, 101, 103, 104, 106, 107, 109, 112, 113, 116, 118, 122, 124, 127
Offset: 1

Views

Author

Keywords

Comments

2007. For example, 37 = 18 + 19; 48 = 15 + 16 + 17; 56 = 5 + 6 + 7 + 8 + 9 + 10 + 11. (Edited by M. F. Hasler, Aug 29 2020: "positive" was missing here. If nonnegative integers are allowed, none of the triangular numbers 3, 6, 10, ... would be in the corresponding sequence. If negative integers are also allowed, it would only have powers of 2 (A000079) which are the only positive integers not the sum of more than one consecutive positive integers, since any x > 0 is the sum of 1-x through x.)
Numbers that are the difference of two triangular numbers in exactly two ways.
Numbers with largest odd divisor a prime number. - Juri-Stepan Gerasimov, Aug 16 2016
Numbers k for which A001222(A000265(k)) = 1. - Antti Karttunen, Jul 09 2020

Crossrefs

Subsequences: A334101, A335431, A335911.
Subsequence of A093641 and of A336101.

Programs

  • Haskell
    a038550 n = a038550_list !! (n-1)
    a038550_list = filter ((== 2) . a001227) [1..]
    -- Reinhard Zumkeller, May 01 2012
    
  • Mathematica
    Select[Range[127],DivisorSigma[0,Max[Select[Divisors[#],OddQ]]]-1==1&] (* Jayanta Basu, Apr 30 2013 *)
    fQ[n_] := Module[{p, e}, {p, e} = Transpose[FactorInteger[n]]; (Length[p] == 2 && p[[1]] == 2 && e[[2]] == 1) || (Length[p] == 1 && p[[1]] > 2 && e[[1]] == 1)]; Select[Range[2, 127], fQ] (* T. D. Noe, Apr 30 2013 *)
    upto=150;Module[{pmax=PrimePi[upto],tmax=Ceiling[Log[2,upto]]}, Select[ Sort[ Flatten[ Outer[ Times, Prime[ Range[ 2,pmax]], 2^Range[0,tmax]]]],#<=upto&]] (* Harvey P. Dale, Oct 18 2013 *)
    Flatten@Position[PrimeQ[BitShiftRight[#, IntegerExponent[#, 2]]&/@Range[#]], True]&@127 (* Federico Provvedi, Dec 14 2021 *)
  • PARI
    is(n)=isprime(n>>valuation(n,2)) \\ Charles R Greathouse IV, Apr 30 2013

Formula

A001227(a(n)) = 2. - Reinhard Zumkeller, May 01 2012
a(n) ~ 0.5 n log n. - Charles R Greathouse IV, Apr 30 2013
A000265(a(n)) is a prime. - Juri-Stepan Gerasimov, Aug 16 2016
Sum_{n>=1} 1/a(n)^s = (2^s*P(s) - 1)/(2^s - 1), for s > 1, where P is the prime zeta function. - Amiram Eldar, Dec 19 2020

Extensions

Edited by N. J. A. Sloane at the suggestion of Zak Seidov, Sep 15 2007

A332214 Mersenne-prime fixing variant of permutation A163511: a(n) = A332212(A163511(n)).

Original entry on oeis.org

1, 2, 4, 3, 8, 9, 6, 7, 16, 27, 18, 49, 12, 21, 14, 5, 32, 81, 54, 343, 36, 147, 98, 25, 24, 63, 42, 35, 28, 15, 10, 31, 64, 243, 162, 2401, 108, 1029, 686, 125, 72, 441, 294, 175, 196, 75, 50, 961, 48, 189, 126, 245, 84, 105, 70, 155, 56, 45, 30, 217, 20, 93, 62, 11, 128, 729, 486, 16807, 324, 7203, 4802, 625, 216, 3087, 2058, 875
Offset: 0

Views

Author

Antti Karttunen, Feb 09 2020

Keywords

Comments

Any Mersenne prime (A000668) times any power of 2, i.e., sequence A335431, is fixed by this map (note the indexing), including also all even perfect numbers. It is not currently known whether there are any additional fixed points.
Because a(n) has the same prime signature as A163511(n), it implies that applying A046523 and A052409 to this sequence gives the same results as with A163511, namely, sequences A278531 and A365805. - Antti Karttunen, Oct 09 2023

Crossrefs

Cf. A163511, A332211, A332212, A332215 (inverse permutation).
Cf. A278531 [= A046523(a(n))], A290251 [= A001222(a(n))], A365805 [= A052409(a(n))], A366372 [= a(n)-n], A366373 [= gcd(n,a(n))], A366374 (numerator of n/a(n)), A366375 (denominator of n/a(n)), A366376.
Cf. A000043, A000668, A000396, A324200, A335431 (conjectured to give all the fixed points).

Programs

  • PARI
    A332214(n) = A332212(A163511(n));
    
  • PARI
    \\ Needs precomputed data for A332211:
    v332211 = readvec("b332211_to.txt"); \\ Prepared with gawk ' { print $2 } ' < b332211.txt > b332211_to.txt
    A332211(n) = v332211[n];
    A332214(n) = if(!n, 1, my(i=1, p=A332211(i), t=1); while(n>1, if(!(n%2), (t*=p), i++; p=A332211(i)); n >>= 1); (t*p)); \\ Antti Karttunen, Oct 09 2023

Formula

a(n) = A332212(A163511(n)).

A332215 Mersenne-prime fixing variant of A243071: a(n) = A243071(A332213(n)).

Original entry on oeis.org

0, 1, 3, 2, 15, 6, 7, 4, 5, 30, 63, 12, 255, 14, 29, 8, 511, 10, 1023, 60, 13, 126, 2047, 24, 23, 510, 9, 28, 4095, 58, 31, 16, 125, 1022, 27, 20, 16383, 2046, 509, 120, 32767, 26, 65535, 252, 57, 4094, 262143, 48, 11, 46, 1021, 1020, 1048575, 18, 119, 56, 2045, 8190, 2097151, 116, 4194303, 62, 25, 32, 503, 250, 8388607, 2044, 4093, 54, 16777215, 40
Offset: 1

Views

Author

Antti Karttunen, Feb 09 2020

Keywords

Comments

Any Mersenne prime (A000668) times any power of 2 (i.e., 2^k, for k>=0) is fixed by this sequence, including also all even perfect numbers.
From Antti Karttunen, Jul 10 2020: (Start)
This is a "tuned variant" of A243071, and has many of the same properties.
For example, for n > 1, A007814(a(n)) = A007814(n) - A209229(n), that is, this map preserves the 2-adic valuation of n, except when n is a power of two, in which cases that value is decremented by one, and in particular, a(2^k * n) = 2^k * a(n) for all n > 1. Also, like A243071, this bijection maps primes to the terms of A000225 (binary repunits). However, the "tuning" (A332213) has a specific effect that each Mersenne prime (A000668) is mapped to itself. Therefore the terms of A335431 are fixed by this map. Furthermore, I conjecture that there are no other fixed points. For the starters, see the proof in A335879, which shows that at least none of the terms of A335882 are fixed.
(End)

Crossrefs

Cf. A243071, A332210, A332213, A332214 (inverse permutation), A335431 (conjectured to be all the fixed points), A335879.

Programs

Formula

a(n) = A243071(A332213(n)).
For all n >= 1, a(A335431(n)) = A335431(n), a(A335882(n)) = A335879(n). - Antti Karttunen, Jul 10 2020

A335882 Numbers k for which A331410(k) = 2.

Original entry on oeis.org

5, 9, 10, 11, 13, 18, 20, 21, 22, 23, 26, 36, 40, 42, 44, 46, 47, 49, 52, 61, 72, 80, 84, 88, 92, 93, 94, 98, 104, 122, 144, 160, 168, 176, 184, 186, 188, 191, 196, 208, 217, 223, 244, 288, 320, 336, 352, 368, 372, 376, 381, 382, 383, 392, 416, 434, 446, 488, 576, 640, 672, 704, 736, 744, 752, 762, 764, 766, 784, 832, 868, 889, 892, 961
Offset: 1

Views

Author

Antti Karttunen, Jun 28 2020

Keywords

Comments

Numbers k such that A000265(k) is either in A144482 or in A335874.
Each term is either of the form A335874(n)*2^k, for some n >= 2, and k >= 0, or a product of two terms of A335431, whether distinct or not.

Crossrefs

Row 2 of A335430.
Cf. A331410, A335431, A335874 (after its initial 2, gives the primes in this sequence), A144482 (odd semiprimes in this sequence).
Cf. also A334102.

Programs

A335430 Square array where row n lists all numbers k for which A331410(k) = n, read by falling antidiagonals.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 8, 7, 9, 15, 16, 12, 10, 17, 25, 32, 14, 11, 19, 29, 73, 64, 24, 13, 27, 37, 75, 125, 128, 28, 18, 30, 45, 85, 145, 365, 256, 31, 20, 33, 50, 87, 149, 375, 625, 512, 48, 21, 34, 51, 89, 173, 425, 725, 1249, 1024, 56, 22, 35, 53, 95, 185, 435, 745, 1489, 3125, 2048, 62, 23, 38, 55, 101, 219, 445, 841, 1825, 3625, 6245
Offset: 0

Views

Author

Antti Karttunen, Jun 28 2020

Keywords

Comments

Array is read by descending antidiagonals with (n,k) = (0,0), (0,1), (1,0), (0,2), (1,1), (2,0), ... where A(n,k) is the (k+1)-th solution x to A331410(x) = n. The row indexing (n) starts from 0, and column indexing (k) also from 0.
For any odd prime p that appears on row n, p+1 appears on row n-1.
The e-th powers of the terms on row n form a subset of terms on row (e*n). More generally, a product of terms that occur on rows i_1, i_2, ..., i_k can be found at row (i_1 + i_2 + ... + i_k), because A331410 is completely additive.

Examples

			The top left corner of the array:
  n\k |    0     1     2     3     4     5     6     7     8     9
------+----------------------------------------------------------------
   0  |    1,    2,    4,    8,   16,   32,   64,  128,  256,  512, ...
   1  |    3,    6,    7,   12,   14,   24,   28,   31,   48,   56, ...
   2  |    5,    9,   10,   11,   13,   18,   20,   21,   22,   23, ...
   3  |   15,   17,   19,   27,   30,   33,   34,   35,   38,   39, ...
   4  |   25,   29,   37,   45,   50,   51,   53,   55,   57,   58, ...
   5  |   73,   75,   85,   87,   89,   95,  101,  109,  111,  113, ...
   6  |  125,  145,  149,  173,  185,  219,  225,  250,  255,  261, ...
   7  |  365,  375,  425,  435,  445,  447,  449,  475,  493,  499, ...
   8  |  625,  725,  745,  841,  865,  925,  997, 1009, 1073, 1095, ...
   9  | 1249, 1489, 1825, 1875, 1993, 2017, 2117, 2125, 2175, 2225, ...
etc.
		

Crossrefs

Cf. A331410.
Cf. A329662 (the leftmost column), A000079, A335431, A335882 (rows 0, 1 and 2).
Cf. also A334100 (an analogous array for the map k -> k - k/p), and A335910.

Programs

  • PARI
    up_to = 78-1; \\ = binomial(12+1,2)-1
    memoA331410 = Map();
    A331410(n) = if(1==n,0,my(v=0); if(mapisdefined(memoA331410,n,&v), v, my(f=factor(n)); v = sum(k=1,#f~,if(2==f[k,1],0,f[k,2]*(1+A331410(f[k,1]+1)))); mapput(memoA331410,n,v); (v)));
    memoA335430sq = Map();
    A335430sq(n, k) = { my(v=0); if((0==k), v = -1, if(!mapisdefined(memoA335430sq,[n,k-1],&v), v = A335430sq(n, k-1))); for(i=1+v,oo,if(A331410(1+i)==n,mapput(memoA335430sq,[n,k],i); return(1+i))); };
    A335430list(up_to) = { my(v = vector(1+up_to), i=0); for(a=0,oo, for(col=0,a, i++; if(i > #v, return(v)); v[i] = A335430sq(col,(a-(col))))); (v); };
    v335430 = A335430list(up_to);
    A335430(n) = v335430[1+n];
    for(n=0,up_to,print1(A335430(n),", "));

A335876 a(1) = 2, and for n > 1, a(n) = n + (n/p), where p is largest prime dividing n, A006530(n).

Original entry on oeis.org

2, 3, 4, 6, 6, 8, 8, 12, 12, 12, 12, 16, 14, 16, 18, 24, 18, 24, 20, 24, 24, 24, 24, 32, 30, 28, 36, 32, 30, 36, 32, 48, 36, 36, 40, 48, 38, 40, 42, 48, 42, 48, 44, 48, 54, 48, 48, 64, 56, 60, 54, 56, 54, 72, 60, 64, 60, 60, 60, 72, 62, 64, 72, 96, 70, 72, 68, 72, 72, 80, 72, 96, 74, 76, 90, 80, 84, 84, 80, 96, 108, 84, 84
Offset: 1

Views

Author

Antti Karttunen, Jun 28 2020

Keywords

Crossrefs

Cf. A006530, A052126, A171462, A331410, A334097, A335431 (positions of two's powers > 2).

Programs

  • Mathematica
    Array[# (1 + 1/FactorInteger[#][[-1, 1]]) &, 83] (* Michael De Vlieger, Jul 08 2020 *)
  • PARI
    A335876(n) = if(1==n,2,n + (n/vecmax(factor(n)[, 1])));

Formula

a(n) = n + A052126(n).
Showing 1-10 of 20 results. Next