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: Tim Cieplowski

Tim Cieplowski's wiki page.

Tim Cieplowski has authored 4 sequences.

A262767 Minimum perimeter of a rectangle with area n and integer sides.

Original entry on oeis.org

4, 6, 8, 8, 12, 10, 16, 12, 12, 14, 24, 14, 28, 18, 16, 16, 36, 18, 40, 18, 20, 26, 48, 20, 20, 30, 24, 22, 60, 22, 64, 24, 28, 38, 24, 24, 76, 42, 32, 26, 84, 26, 88, 30, 28, 50, 96, 28, 28, 30, 40, 34, 108, 30, 32, 30, 44, 62, 120, 32
Offset: 1

Author

Tim Cieplowski, Sep 30 2015

Keywords

Comments

a(n) >= A027709(n) = 2*ceiling(2*sqrt(n)). - Dmitry Kamenetsky, Feb 27 2017

Examples

			Since 2 * (2 + 3) < 2 * (1+6), a(6) = 10.
		

Crossrefs

Cf. A063655 (semiperimeter).
Two-dimensional equivalent of A075777.

Programs

  • Mathematica
    f[n_] := Block[{w = Round@ Sqrt@ n}, While[Mod[n, w] != 0, w--]; 2 (w + Round[n/w])]; Array[f, {60}] (* Michael De Vlieger, Oct 01 2015 *)
  • PARI
    a(n) = {local(d); d=divisors(n); 2*(d[(length(d)+1)\2] + d[length(d)\2+1])}
    vector(50, n, a(n)) \\ Altug Alkan, Oct 16 2015
  • Python
    def perimeter(area):
        width = round(area ** (1/2))
        while area % width != 0:
            width -= 1
        return 2*(width + round(area/width))
    

Formula

a(n) = 2*A063655(n). - Michel Marcus, Oct 01 2015

A253620 Maximum number of segments in nonintersecting increasing path on n X n hexagonal (isogonal) grid.

Original entry on oeis.org

0, 3, 6, 10, 14, 19, 25, 30, 36
Offset: 1

Author

Tim Cieplowski, Jan 06 2015

Keywords

Comments

The path cannot intersect itself, not even on single points. "Increasing" means that the (Euclidean) length of each segment must be strictly greater than that of the previous one.
The analogous sequence for a triangular (isogonal) grid seems to satisfy a(n) = 2n+1, with 2^(n-2) such paths up to isomorphism.

Examples

			An example for a(4) = 10
       .   .   .   .
    09   .   .   .   .
  01   .   .   .   .   .
00  07   .   .   .   .  10
  02  05   .   .   .  08
     .   .   .   .  06
      03   .   .  04
		

Crossrefs

Cf. A226595.

A227050 Number of essentially different ways of arranging numbers 1 through 2n around a circle so that the sum and absolute difference of each pair of adjacent numbers are prime.

Original entry on oeis.org

0, 0, 0, 0, 0, 2, 1, 4, 88, 0, 976, 22277, 22365, 376002, 3172018, 5821944, 10222624, 424452210, 6129894510, 38164752224
Offset: 1

Author

Tim Cieplowski, Jun 29 2013

Keywords

Comments

See a similar problem, but for the set of numbers {0 through (n-1)}. - Stanislav Sykora, May 30 2014

Examples

			For n = 6 the a(6) = 2 solutions are (1, 4, 9, 2, 5, 12, 7, 10, 3, 8, 11, 6) and (1, 6, 11, 8, 3, 10, 7, 4, 9, 2, 5, 12) because abs(1 - 4) = 3 and 1 + 4 = 5 are prime, etc.
		

Crossrefs

Cf. similar sequences: A051252 (with sums of neighbors prime), A242527 (with sums of neighbors prime), A228626 (with differences of neighbors prime), A242528 (with sums and differences of neighbors prime).

Programs

  • Mathematica
    A227050[n_] :=
    Count[Map[lpf, Map[j1f, Permutations[Range[2,2 n]]]], 0]/2;
    j1f[x_] := Join[{1}, x, {1}];
    lpf[x_] := Length[
       Join[Select[asf[x], ! PrimeQ[#] &],
        Select[Differences[x], ! PrimeQ[#] &]]];
    asf[x_] := Module[{i}, Table[x[[i]] + x[[i + 1]], {i, Length[x] - 1}]];
    Table[A227050[n], {n, 1, 6}]
    (* OR, a less simple, but more efficient implementation. *)
    A227050[n_, perm_, remain_] := Module[{opt, lr, i, new},
       If[remain == {},
         If[PrimeQ[First[perm] - Last[perm]] &&
           PrimeQ[First[perm] + Last[perm]], ct++];
         Return[ct],
         opt = remain; lr = Length[remain];
         For[i = 1, i <= lr, i++,
          new = First[opt]; opt = Rest[opt];
          If[! (PrimeQ[Last[perm] - new] && PrimeQ[Last[perm] + new]),
           Continue[]];
          A227050[n, Join[perm, {new}],
           Complement[Range[2 n], perm, {new}]];
          ];
         Return[ct];
         ];
       ];
    Table[ct = 0; A227050[n, {1}, Range[2, 2 n]]/2, {n, 1, 10}]
    (* Robert Price, Oct 22 2018 *)

Extensions

a(15)-a(18) added by Tim Cieplowski, Jan 04 2015
a(19) from Fausto A. C. Cariboni, Jun 06 2017
a(20) from Bert Dobbelaere, Feb 15 2020

A226108 Primes remaining prime if all but two digits are deleted.

Original entry on oeis.org

11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 113, 131, 137, 173, 179, 197, 311, 317, 431, 617, 719, 1117, 1171, 4111, 11113, 11117, 11119, 11131, 11171, 11173, 11197, 11311, 11317, 11719, 11731, 13171, 13711, 41113
Offset: 1

Author

Tim Cieplowski, May 26 2013

Keywords

Comments

Subsequence of A069488.

Examples

			For a(3)=137, all pairs of two digits (in their original order) 13, 17, and 37 are prime.
		

References

  • C. Caldwell, Truncatable primes, J. Recreational Math., 19:1 (1987) 30-33.

Crossrefs

Programs

  • Mathematica
    testQ[n_] := n > 9 && Catch[Block[{d = IntegerDigits@n}, Do[If[! PrimeQ[ d[[j]] + 10*d[[i]]], Throw@False], {j, 2, Length@d}, {i, j-1}]; True]]; Select[Prime@ Range[10^5], testQ] (* Giovanni Resta, May 28 2013 *)