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 41-50 of 75 results. Next

A211017 T(n,k) = total area of all squares and rectangles of area 2^(k-1) after 2^n stages in the toothpick structure of A139250, n>=1, k>=1, assuming the toothpicks have length 2. Triangle read by rows.

Original entry on oeis.org

0, 0, 8, 8, 24, 16, 40, 104, 48, 32, 168, 424, 208, 96, 64, 680, 1704, 848, 416, 192, 128, 2728, 6824, 3408, 1696, 832, 384, 256, 10920, 27304, 13648, 6816, 3392, 1664, 768, 512, 43688, 109924, 54608, 27296, 13632, 6784, 3328, 1536, 1024
Offset: 1

Views

Author

Omar E. Pol, Sep 21 2012

Keywords

Comments

All internal regions in the toothpick structure are squares and rectangles. The area of every internal region is a power of 2.

Examples

			For n = 5 in the toothpick structure after 2^5 stages we have that:
T(5,1) = 168 is the total area of all squares of size 1 X 1.
T(5,2) = 424 is the total area of all rectangles of size 1 X 2.
T(5,3) = 208 is the total area of all squares of size 2 X 2 and of all rectangles of size 1 X 4.
T(5,4) = 96 is the total area of all rectangles of size 2 X 4.
T(5,5) = 64 is the total area of all rectangles of size 2 X 8.
Triangle begins:
      0;
      0,     8;
      8,    24,    16;
     40,   104,    48,   32;
    168,   424,   208,   96,   64;
    680,  1704,   848,  416,  192,  128;
   2728,  6824,  3408, 1696,  832,  384, 256;
  10920, 27304, 13648, 6816, 3392, 1664, 768, 512;
		

Crossrefs

Formula

T(n,k) = A211016(n,k)*2^(k-1).
T(n,1) = 4*A020988(n-2), n>=2.

A211019 Triangle read by rows: T(n,k) = number of squares and rectangles of area 2^(k-1) after 2^n stages in the toothpick structure of A139250, divided by 4, n>=1, k>=1, assuming the toothpicks have length 2.

Original entry on oeis.org

0, 0, 1, 2, 3, 1, 10, 13, 3, 1, 42, 53, 13, 3, 1, 170, 213, 53, 13, 3, 1, 682, 853, 213, 53, 13, 3, 1, 2730, 3413, 853, 213, 53, 13, 3, 1, 10922, 13653, 3413, 853, 213, 53, 13, 3, 1, 43690, 54613, 13653, 3413, 853, 213, 53, 13, 3, 1, 174762, 218453
Offset: 1

Views

Author

Omar E. Pol, Sep 24 2012

Keywords

Comments

All internal regions in the toothpick structure are squares and rectangles.

Examples

			Triangle begins:
0;
0,         1;
2,         3,     1;
10,       13,     3,    1;
42,       53,    13,    3,   1;
170,     213,    53,   13,   3,   1;
682,     853,   213,   53,  13,   3,  1;
2730,   3413,   853,  213,  53,  13,  3,  1;
10922, 13653,  3413,  853, 213,  53, 13,  3, 1;
43690, 54613, 13653, 3413, 853, 213, 53, 13, 3, 1;
		

Crossrefs

Row sums give 0 together with A014825.

Formula

T(n,k) = A211016(n,k)/4.
T(n,1) = A020988(n-2), n>=2.

A060590 Numerator of the expected time to finish a random Tower of Hanoi problem with n disks using optimal moves.

Original entry on oeis.org

0, 2, 2, 14, 10, 62, 42, 254, 170, 1022, 682, 4094, 2730, 16382, 10922, 65534, 43690, 262142, 174762, 1048574, 699050, 4194302, 2796202, 16777214, 11184810, 67108862, 44739242, 268435454, 178956970, 1073741822, 715827882, 4294967294
Offset: 0

Views

Author

Henry Bottomley, Apr 05 2001

Keywords

Examples

			a(2)=2 since there are nine equally likely possibilities, with times required of 0,1,1,2,2,3,3,3,3 giving an average of 18/9 = 2/1.
		

Crossrefs

Denominator is A010684(n). Cf. A007798, A060586, A060589, A020988 (even bisection).

Programs

  • PARI
    a(n)={2*(2^n - 1)*(2 - (-1)^n)/3} \\ Harry J. Smith, Jul 07 2009

Formula

a(n) = 2*(2^n - 1)*(2 - (-1)^n)/3.
a(2n) = A020988(n-1).
From Ralf Stephan, Mar 07 2003: (Start)
G.f.: (4*x^3+2*x^2+2*x)/(4*x^4-5*x^2+1).
a(n+4) = 5*a(n+2) - 4*a(n). (End)

A108019 a(n) = (8^n - 1)*4/7.

Original entry on oeis.org

0, 4, 36, 292, 2340, 18724, 149796, 1198372, 9586980, 76695844, 613566756, 4908534052, 39268272420, 314146179364, 2513169434916, 20105355479332, 160842843834660, 1286742750677284, 10293942005418276, 82351536043346212
Offset: 0

Views

Author

Alexandre Wajnberg, May 31 2005

Keywords

Comments

Numbers n whose binary representation is 100, n times.

Examples

			a(3)=292 because 292 translated in base 2 is three times 100: 100100100.
From _Zerinvary Lajos_, Jan 14 2007: (Start)
Octal............Decimal
0......................0
4......................4
44....................36
444..................292
4444................2340
44444..............18724
444444............149796
4444444..........1198372
44444444.........9586980
444444444.......76695844
4444444444.....613566756,
etc. (End)
		

Crossrefs

Cf. A020988.

Programs

Formula

a(n) = 8*a(n-1) + 4 with n>0, a(0)=0. - Vincenzo Librandi, Nov 13 2010
From Colin Barker, Oct 15 2012: (Start)
a(n) = 9*a(n-1) - 8*a(n-2).
G.f.: 4*x/((x-1)*(8*x-1)). (End)

Extensions

More terms from Robert G. Wilson v, Jun 01 2005

A152571 Triangle T(n,k) read by rows: T(n,n) = -1, T(n,0) = 4^(n - 1), T(n,k) = -4^(n - k - 1), 1 <= k <= n - 1.

Original entry on oeis.org

-1, 1, -1, 4, -1, -1, 16, -4, -1, -1, 64, -16, -4, -1, -1, 256, -64, -16, -4, -1, -1, 1024, -256, -64, -16, -4, -1, -1, 4096, -1024, -256, -64, -16, -4, -1, -1, 16384, -4096, -1024, -256, -64, -16, -4, -1, -1, 65536, -16384, -4096, -1024, -256, -64, -16, -4, -1, -1
Offset: 0

Views

Author

Roger L. Bagula, Dec 08 2008

Keywords

Examples

			Triangle begins:
      -1;
       1,     -1;
       4,     -1,     -1;
      16,     -4,     -1,    -1;
      64,    -16,     -4,    -1,    -1;
     256,    -64,    -16,    -4,    -1,   -1;
    1024,   -256,    -64,   -16,    -4,   -1,  -1;
    4096,  -1024,   -256,   -64,   -16,   -4,  -1,  -1;
   16384,  -4096,  -1024,  -256,   -64,  -16,  -4,  -1, -1;
   65536, -16384,  -4096, -1024,  -256,  -64, -16,  -4, -1, -1;
  262144, -65536, -16384, -4096, -1024, -256, -64, -16, -4, -1, -1;
     ...
		

Crossrefs

Row sums (except row 0): A020988.

Programs

  • Mathematica
    b[0] = {-1}; b[1] = {1, -1};
    b[n_] := b[n] = Join[{4^(n - 1)}, {-b[n - 1][[1]]}, Table[b[n - 1][[i]], {i, 2, Length[b[n - 1]]}]];
    Flatten[Table[b[n], {n, 0, 10}]]
  • Maxima
    T(n, k) := if k = n then -1 else if k = 0 then 4^(n - 1) else -4^(n - k - 1)$
    create_list(T(n, k), n, 0, 20, k, 0, n); /* Franck Maminirina Ramaharo, Jan 08 2019 */

Formula

From Franck Maminirina Ramaharo, Jan 08 2019: (Start)
G.f.: -(1 - 5*y + 2*x*y^2)/(1 - (4 + x)*y + 4*x*y^2).
E.g.f.: -(4 - x - (2 - x)*exp(4*y) + (6 - 2*x)*exp(x*y))/(8 - 2*x). (End)

Extensions

Edited by Franck Maminirina Ramaharo, Jan 08 2019

A154570 The main diagonal of the successive differences of A154127.

Original entry on oeis.org

1, 3, -4, 2, -6, -2, -14, -18, -46, -82, -174, -338, -686, -1362, -2734, -5458, -10926, -21842, -43694, -87378, -174766, -349522, -699054, -1398098, -2796206, -5592402, -11184814, -22369618, -44739246, -89478482, -178956974, -357913938, -715827886
Offset: 0

Views

Author

Paul Curtz, Jan 12 2009

Keywords

Crossrefs

Programs

Formula

a(n) = a(n-1) + 2*a(n-2), n>0.
a(n+2) = 2*(-1)^(n+1)*A140966(n).
a(n+5) = -2*A083582(n).
a(2n+1) = 3 - A078008(2n) = 3 - A047849(n).
a(2n+2) = -4 - A078008(2n+1) = -4 - A020988(n).
G.f.: (1+2*x-9*x^2)/((1+x)*(1-2*x)). - R. J. Mathar, Feb 25 2009

Extensions

Edited and extended by R. J. Mathar, Feb 25 2009

A176965 a(n) = 2^(n-1) - (2^n*(-1)^n + 2)/3.

Original entry on oeis.org

1, 0, 6, 2, 26, 10, 106, 42, 426, 170, 1706, 682, 6826, 2730, 27306, 10922, 109226, 43690, 436906, 174762, 1747626, 699050, 6990506, 2796202, 27962026, 11184810, 111848106, 44739242, 447392426, 178956970, 1789569706, 715827882, 7158278826
Offset: 1

Views

Author

Roger L. Bagula, Apr 29 2010

Keywords

Comments

The ratio a(n+1)/a(n) approaches 10 for even n and 2/5 for odd n as n->infinity.

Crossrefs

Merger of A020988 (even n) and A020989 (odd n).

Programs

  • GAP
    List([1..30], n-> (3*2^(n-1) -(-2)^n -2)/3); # G. C. Greubel, Dec 28 2019
  • Magma
    [(3*2^(n-1) -(-2)^n -2)/3: n in [1..30]]; // G. C. Greubel, Dec 28 2019
    
  • Maple
    seq( (3*2^(n-1) -(-2)^n -2)/3, n=1..30); # G. C. Greubel, Dec 28 2019
  • Mathematica
    a[n_]:= a[n]= 2^(n-1)*If[n==1, 1, a[n-1]/2 +(-1)^(n-1)*Sqrt[(5 +4*(-1)^(n-1) )]/2]; Table[a[n], {n,30}]
    LinearRecurrence[{1,4,-4}, {1,0,6}, 30] (* G. C. Greubel, Dec 28 2019 *)
  • PARI
    vector(30, n, (3*2^(n-1) -(-2)^n -2)/3 ) \\ G. C. Greubel, Dec 28 2019
    
  • Sage
    [(3*2^(n-1) -(-2)^n -2)/3 for n in (1..30)] # G. C. Greubel, Dec 28 2019
    

Formula

From R. J. Mathar, Apr 30 2010: (Start)
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3).
G.f.: x*(1 - x + 2*x^2)/( (1-x)*(1+2*x)*(1-2*x) ). (End)
a(n) = A087231(n), n > 2. - R. J. Mathar, May 03 2010
a(2n-1) = A061547(2n), a(2n) = A061547(2n-1), n > 0. - Yosu Yurramendi, Dec 23 2016
a(n+1) = 2*A096773(n), n > 0. - Yosu Yurramendi, Dec 30 2016
a(2n-1) = A020989(n-1), a(2n) = A020988(n-1), n > 0. - Yosu Yurramendi, Jan 03 2017
a(2n-1) = (A083597(n-1) + A000302(n-1))/2, a(2n) = (A083597(n-1) - A000302(n-1))/2, n > 0. - Yosu Yurramendi, Mar 04 2017
a(n+2) = 4*a(n) + 2, a(1) = 1, a(2) = 0, n > 0. - Yosu Yurramendi, Mar 07 2017
a(n) = (-16 + (9 - (-1)^n) * 2^(n - (-1)^n))/24. - Loren M. Pearson, Dec 28 2019
E.g.f.: (3*exp(2*x) - 4*exp(x) + 3 - 2*exp(-2*x))/6. - G. C. Greubel, Dec 28 2019
a(n) = (2^n*5^(n mod 2) - 4)/6. - Heinz Ebert, Jun 29 2021

A213704 Catalan Unranking function U(size,rank) for totally balanced binary strings (converted to decimal). Each row 'size' of an array lists all A000108(size) such items in standard lexicographic order, followed by an infinite number of zeros.

Original entry on oeis.org

0, 0, 2, 0, 0, 10, 0, 0, 12, 42, 0, 0, 0, 44, 170, 0, 0, 0, 50, 172, 682, 0, 0, 0, 52, 178, 684, 2730, 0, 0, 0, 56, 180, 690, 2732, 10922, 0, 0, 0, 0, 184, 692, 2738, 10924, 43690, 0, 0, 0, 0, 202, 696, 2740, 10930, 43692, 174762, 0, 0, 0, 0, 204, 714, 2744, 10932, 43698, 174764, 699050, 0
Offset: 0

Views

Author

Antti Karttunen, Aug 10 2012

Keywords

Comments

The Scheme-function CatalanUnrank has been adapted from Frank Ruskey's thesis. This gives essentially the same information as A014486 which can be obtained from this array by concatenating all A000108(s) nonzero terms from the beginning of each row s to one sequence.
See the comments and pictures at A014486 for more information.

Crossrefs

The leftmost column: A020988. For all n>1, A014486(n) = A213704bi(A072643(n),(n - A014137(A072643(n)-1))). Cf. A009766, A215406, A153250.

Programs

  • Scheme
    (define (A213704 n) (A213704bi (A002262 n) (A025581 n)))
    (define (A213704bi row col) (cond ((zero? row) 0) ((>= col (A000108 row)) 0) (else (CatalanUnrank row col))))
    (define (CatalanUnrank size rank) (let loop ((a 0) (m (-1+ size)) (y size) (rank rank) (c (A009766tr (-1+ size) size))) (if (negative? m) a (if (>= rank c) (loop (1+ (* 2 a)) m (-1+ y) (- rank c) (A009766tr m (-1+ y))) (loop (* 2 a) (-1+ m) y rank (A009766tr (-1+ m) y))))))

A345253 Maximal Fibonacci tree: Arrangement of the positive integers as labels of a complete binary tree.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 13, 11, 14, 16, 21, 12, 15, 17, 22, 18, 23, 26, 34, 19, 24, 27, 35, 29, 37, 42, 55, 20, 25, 28, 36, 30, 38, 43, 56, 31, 39, 44, 57, 47, 60, 68, 89, 32, 40, 45, 58, 48, 61, 69, 90, 50, 63, 71, 92, 76, 97, 110, 144, 33, 41, 46, 59, 49
Offset: 1

Views

Author

J. Parker Shectman, Jun 12 2021

Keywords

Comments

Every positive integer occurs exactly once, so that, as a sequence, a(n) is a permutation of the positive integers.
Descending from the root node 1, generate tree by outer composition of L(n) = n + F(Finv(n)) and R(n) = n + F(Finv(n) + 1), respectively, according to left or right branching, where F(n) = A000045(n) are the Fibonacci numbers and Finv(n) = A130233(n) is the 'lower' Fibonacci inverse. This produces each number by maximal Fibonacci expansion (cf. example below of Method 2, entry A343152, and links).
(Level of tree): The number of terms in this expansion of n is the level of the tree on which n appears, A112310(n-1) + 1 = A200648(n+1). The number of terms in the expansion of a(n) is floor(log_2(n)) + 1 = A113473(n) = A070939(n) = A029837(n+1).
"Maximal Fibonacci expansion" maximizes the sum of coefficients over all Fibonacci numbers (of positive index), allowing both F(1) = 1 and F(2) = 1. Thus, it is just an expansion and not a representation (like "greedy" and "lazy"), as it "breaks the rule" by using two bits that correspond to elements of equal value, rather than using distinct basis elements (link). This reveals connections to the cf. sequences: Binary strings that emerge in lexicographic order from "maximal Fibonacci gaps" (example), binary trees of the positive integers, and I-D arrays "harvested" from the trees. To define the expansion uniquely, always include F(1), so that the expansion of positive integer n equals F(1) for n = 1 and F(1) prepended to the lazy Fibonacci representation of n-1 for n > 1. Hence, a(1) = 1, and for n > 1, a(n) = A095903(n-1) + 1. The "redundant" expansion arranges the positive integers in the single binary tree {T(n,k)}, rather than the two trees at A255773 and A255774 that result from representation (see link).
(Left-to-right order in tree): Each F(t)-sized block (F(t+1), ..., F(t+2) - 1) of successive positive integers ("Fibonacci cohort" t) appears in right-to-left order in the tree as reordered in A343152, where elements of each cohort appear consecutively (see link).
Descending from the root node 1, generate tree by the inner composition of A026351 and A026352, that is, one plus the sequences of lower and upper Wythoff numbers, A000201 and A001950, respectively, according to left or right branching (see example below of Method 1 and links).
Generate tree from (one plus) the number of (initial) zeros on the positive integers for the outer composition of sequences, A060143 and A060144, respectively, according to left or right branching descending from the identity (c.f example below of Method 3 and links).
The lower Wythoff numbers, A000201, appear exclusively in the 1st, 3rd, 5th, ... right clades of the tree, while the upper Wythoff numbers A001950, appear exclusively in the 2nd, 4th, 6th, ... right clades of the tree. Here, the k-th right clade comprises the nodes at positions 2^(k+1) and 2^k + 1, together with all descendants of the latter (link).
(Duality with tree A232560, and related arrays): Consider the labeled binary trees a(n) = A232560(A059893(n)) and A232560(n) = a(A059893(n)). Labels along maximal straight paths that always branch left in a(n) give rows of array A345252, while labels along maximal straight paths that always branch left in A232560 give rows of array A083047.
Sorting the labels from each successive right clade of the binary tree a(n) gives the successive columns of A083047, while sorting labels from each successive right clade of A232560 gives each successive column of A345252. This makes the trees a(n) and A232560 "blade-duals," blade being a contraction of branch-clade (see entry for A345254 and link). A200648(n)+1 gives the level of the tree on which elements of array first-columns A345252(n,1) and A083047(n,1) appear.
(Palindromes and coincidence of elements): Trees a(n) and A232560 coincide when the sequence of left and right branching is a palindrome: a(A329395(n)) = A232560(A329395(n)). As Kimberling notes (cf. A059893), this happens at fixed points of A059893(n) or, equivalently, at n for which A081242(n) is a palindrome.
The inverse permutation of a(n) as a sequence can be read from a "tetrangle" or "irregular triangle" tableau with F(t) (Fibonacci number) entries on each row t, for t = 1, 2, 3, ..., in which an entry on row t is 2*x the entry x immediately above it on row t-1, if such exists, or otherwise 2*x + 1 the entry x in the corresponding position on row t-2 (thus generating new rows as in A243571 but without sorting the numbers into increasing order, linked reference):
1,
2,
3, 4,
5, 6, 8,
7, 9, 10, 12, 16,
11, 13, 17, 14, 18, 20, 24, 32,
...
With the right-justified tableau substituted by a left-justified tableau, the same procedure yields the inverse permutation for the "minimal Fibonacci tree," A048680(A059893(n)), the "cohort-dual" tree of a(n), where "cohort" t is the F(t)-sized block of successive entries in the tableau (see entry for A345252, linked reference).
(Coincidence of elements): a(A020988(n)) = A048680(A059893(A020988(n))) = A099919(n) and a(A020989(n)) = A048680(A059893(A020989(n))) = A049651(n). Collectively, a(A061547(n)) = A048680(A059893(A061547(n))) = union(A049651(n), A099919(n)).
With two types of duality, the tree forms a quartet of binary-tree arrangements of the positive integers, together with its blade dual A232560, its cohort dual A048680(A059893), and blade dual A048680 of the latter.
Order in the tree is "memory-less": Let a(n) and a(m) label nodes at positions n and m, respectively. Let d1 and d2 be two descending paths, i.e., sequences branching left or right from a starting node. (Nodal positions for the left and right children of the node at position p are given by 2*p and 2*p + 1, resp., and d1 and d2 are compositions of these.) Then a(d1(n)) < a(d2(n)) if and only if a(d1(m)) < a(d2(m)) (linked reference).

Examples

			As a complete binary tree:
                    1
           /                 \
          2                   3
      /       \          /        \
     4         5        6          8
    / \       / \      / \        / \
   7    9    10   13   11   14   16   21
  / \  / \  /  \ /  \ /  \ /  \ /  \ /  \
  ...
By maximal Fibonacci expansion:
                                        F(1)
                      /                                       \
                F(1) + F(2)                               F(1) + F(3)
           /                    \                    /                  \
  F(1) + F(2) + F(3)   F(1) + F(2) + F(4)   F(1) + F(3) + F(4)   F(1) + F(3) + F(5)
  ...
"Fibonacci gaps," or differences between successive indices in maximal Fibonacci expansion above, are A007931(n-1) for n > 1 (see link):
                   *
          /                  \
         1                    2
     /       \           /        \
    11        12        21        22
   /  \      /  \      /  \      /  \
  111  112  121  122  211  212  221  222
  / \  / \  / \  / \  / \  / \  / \  / \
  ...
In examples of the three methods below:
Branch left-right-right down the tree to arrive at nodal position n = 2*(2*(2*1) + 1) + 1 = 11;
Branch right-left-left down the tree to arrive at nodal position n = 2*(2*(2*1 + 1)) = 12.
Tree by inner composition of (one plus) the lower and upper Wythoff sequences, A000201 and A001950 (Method 1):
a(11) = A000201(A001950(A001950(1) + 1) + 1) + 1 = 13.
a(12) = A001950(A000201(A000201(1) + 1) + 1) + 1 = 11.
Tree by (outer) composition of branching functions L(n) = n + F(Finv(n)) and R(n) = n + F(Finv(n) + 1), where F(n) = A000045(n) and Finv(n) = A130233(n) (Method 2):
a(11) = R(R(L(1))) = 13.
a(12) = L(R(R(1))) = 11.
Tree by outer composition of A060143 and A060144 (Wythoff inverse sequences) (Method 3):
a(11) = 13, position of first nonzero in A060144(A060144(A060143(m))) = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ..., for m = 1, 2, 3, ....
a(12) = 11, position of first nonzero in A060143(A060143(A060144(m))) = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ..., for m = 1, 2, 3, ....
		

Crossrefs

Programs

  • Mathematica
    (* For binary tree implementations, see supporting file under LINKS *)
    a[n_] := (x = 0; y = 0; BDn = Reverse[IntegerDigits[n, 2]]; imax = Length[BDn] - 1; For[i = 0, i <= imax, i++, {x, y} = {y + 1, x + y}; If[BDn[[i + 1]] == 1, {x, y} = {y, x + y}]]; y);
    (* Adapted from PARI code of Kevin Ryde *)
  • PARI
    a(n) = my(x=0,y=0); for(i=0,logint(n,2), [x,y]=[y+1,x+y]; if(bittest(n,i), [x,y]=[y,x+y])); y; \\ Kevin Ryde, Jun 19 2021

Formula

a(1) = 1 and for n > 1, a(n) = A095903(n-1) + 1.
a(n) = A232560(A059893(n)).

A065085 Smallest prime having alternating bit sum (A065359) equal to -n, or 0 if no such prime exists.

Original entry on oeis.org

3, 2, 43, 0, 683, 2731, 0, 43691, 174763, 0, 2796203, 44608171, 0, 715827881, 715827883, 0, 114532461227, 183251938027, 0, 2931494136491, 2932031007403, 0, 187647836990123, 748400914639531, 0, 11446649052900011, 45786596211600043, 0
Offset: 0

Views

Author

Robert G. Wilson v, Nov 09 2001

Keywords

Examples

			The smallest number having alternating bit sum -n is (2/3)(4^n-1), which for n=4 is 170 = (10101010)2. The least odd number with alternating bit sum -4 is (10)2 || ( (10101010)2 + (1)2 ) = 683, which is prime, so a(4) = 683. - _Washington Bomfim_, Jan 27 2011
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Plus @@ (-(-1)^Range[Floor[Log2@n + 1]] Reverse@ IntegerDigits[n, 2]); a = Table[ f[ Prime[n]], {n, 1, 10^6} ]; b = Table[0, {12} ]; Do[ If[ a[[n]] < 1 && b[[ -a[[n]] + 1]] == 0, b[[ -a[[n]] + 1]] = Prime[n]], {n, 1, 10^6} ]; b
  • PARI
    II()={i = (2/3)*(4^n-1) + 1 + 2^(2*n+1); if(isprime(i),return(1)); return(0)};
    III()={w = 2^(2*n+3); for(j=1, n+1, i += w; w /= 4; i -= w; if(isprime(i),return(1))); return(0)};
    IV()={i+=6; if(isprime(i), return(1)); w=4; for(j=1, n, i -= w; w*=4; i+=w; if(isprime(i), return(1)));return(0)};
    V()={i += 2^(2*n+4) - 2^(2*n+2); if(isprime(i),return(1));w = i + 2^(2*n+5) - 2^(2*n+4); i = w - 2^(2*n+3) - 2^(2*n+1); if(isprime(i),return(1));w = 2^(2*n+1);for(j=1, n,i += w; w /= 4; i -= w;if(isprime(i),return(1) ));return(0)};
    print("0 3");print("1 2");for(n=2,117, if(II(),print(n," ",i), if(III(),print(n," ",i), if(IV(),print(n," ",i), if(V(),print(n," ",i),if(n%3==0,print(n," 0"),print(n," not found."))))))) \\ Washington Bomfim, Feb 06 2011

Extensions

a(13)-a(27) from Washington Bomfim, Jan 27 2011
Previous Showing 41-50 of 75 results. Next