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-2 of 2 results.

A375256 Number of pairs of antipodal vertices in the level n Hanoi graph.

Original entry on oeis.org

3, 12, 39, 129, 453, 1677, 6429, 25149, 99453, 395517, 1577469, 6300669, 25184253, 100700157, 402726909, 1610760189, 6442745853, 25770393597, 103080394749, 412319219709, 1649272160253, 6597079203837, 26388297940989, 105553154015229, 422212540563453, 1688850011258877, 6755399743045629
Offset: 1

Views

Author

Allan Bickle, Aug 07 2024

Keywords

Comments

A level 1 Hanoi graph is a triangle. Level n+1 is formed from three copies of level n by adding edges between pairs of corner vertices of each pair of triangles. This graph represents the allowable moves in the Towers of Hanoi problem with n disks.
Antipodal vertices are a pair of vertices at maximum distance in a graph. The diameter of the level n Hanoi graph is 2^n - 1.

Examples

			2 example graphs:
                           o
                          / \
                         o---o
                        /     \
             o         o       o
            / \       / \     / \
           o---o     o---o---o---o
Graph:      H_1           H_2
Since the level 1 Hanoi graph is a triangle, a(1) = 3.
		

Crossrefs

Cf. A000225, A029858, A058809 (Hanoi graphs).
Cf. A370933 (antipodal pairs in SierpiƄski triangle graphs).

Programs

  • Mathematica
    A375256[n_] := 3*(2^(2*n - 3) + 3*2^(n - 2) - 1);
    Array[A375256, 30] (* or *)
    LinearRecurrence[{7, -14, 8}, {3, 12, 39}, 30] (* Paolo Xausa, Sep 23 2024 *)
  • PARI
    a(n) = 3*(2^(2*n-3)+3*2^(n-2)-1); \\ Michel Marcus, Aug 08 2024

Formula

a(n) = 3*(2^(2n-3)+3*2^(n-2)-1).
a(n) = A370933(n+1) - 3.
a(n) = 3*A297928(n-2) for n>=2. - Alois P. Heinz, Sep 23 2024

Extensions

More terms from Michel Marcus, Aug 08 2024

A296807 Take a prime, convert it to base 2. Consider it as a string of digits and delete its leftmost and rightmost digit. Leading zeros are kept. Repeat the process. a(n) is the least prime that, in the first n steps of this process, generates a string that is a prime read in base 2.

Original entry on oeis.org

2, 13, 43, 151, 2143, 2143, 12479, 57727, 246527, 4267455487, 276009615632383, 4469780781584383, 576406542684520447
Offset: 0

Views

Author

Paolo P. Lava, Paolo Iachia, Dec 21 2017

Keywords

Comments

a(n) >= 2*4^n + 3*2^n - 1 = A297928(n) >= 2*(4^n + 2^n) + 1 = A085601(n), n > 0. - Iain Fox, Dec 29 2017 (edited by Iain Fox, Jan 08 2018)
a(17) <= 2^163 + 361736822347711983585853439 (probably much smaller), building on a Cunningham chain of length 17 found by Jaroslaw Wroblewski. a(n) exists for n <= 17, and probably for all n. - Jens Kruse Andersen, Jan 21 2018

Examples

			a(1) = 13 because 13 in base 2 is 1101 and 10 is 2 and 13 is the least number with this property;
a(2) = 43 because 43 in base 2 is 101011 while 0101 is 5 and 10 is 2 and 43 is the least number with this property;
a(3) = 151 because 151 in base 2 is 10010111 while 001011 is 11, 0101 is 5 and 10 is 2 and 151 is the least number with this property.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,c,i,j,k,n,ok,x; x:=5; for k from 1 to q do for n from x to q do a:=convert(ithprime(n),base,2); ok:=1; for i from 1 to k do b:=nops(a)-i; while a[b]=0 do b:=b-1; od;
    c:=0; for j from b by -1 to i+1 do c:=2*c+a[j]; od;if not isprime(c) then ok:=0; break; fi; od;if ok=1 then x:=n; print(ithprime(n)); break; fi; od; od; end: P(10^20);
  • Mathematica
    Table[SelectFirst[Prime@ Range[#, # + 10^5] &@ PrimePi[2 (4^n + 2^n) + 1], AllTrue[Map[FromDigits[#, 2] &, Rest@ NestWhileList[Most@ Rest@ # &, IntegerDigits[#, 2], Length@ # > 2 &]], PrimeQ] &], {n, 8}] (* Michael De Vlieger, Dec 29 2017 *)
  • PARI
    a(n) = if(!n, return(2)); forprime(p=2*4^n + 3*2^n - 1, , my(b=p); for(x=1, n, b = (b - (b>=4*2^(logint(p, 2) - 2*x))*4*2^(logint(p, 2) - 2*x) - 1)/2; if(!isprime(b) || (b==2 && x!=n), next(2))); return(p)) \\ Iain Fox, Dec 29 2017 (corrected by Iain Fox, Oct 26 2019)

Extensions

Definition corrected, a(10)-a(12) by Jens Kruse Andersen, Jan 21 2018
Showing 1-2 of 2 results.