g | x | w | all
Bytes Lang Time Link
007Vyxal210904T005402Zemanresu
010Nibbles250905T002528ZAdam
021cQuents250905T000655ZStephen
013Pip210904T020530ZDLosc
080Rockstar230627T100819ZShaggy
048Arturo230627T044135Zchunes
7625Vyxal230627T011810Zlyxal
009Thunno 2 J230626T170806ZThe Thon
037Knight v2.0alpha220918T064207ZSampersa
031Labyrinth220915T052624ZJo King
051jq210904T073539ZRazetime
043jq r210905T122610Zovs
043Python 3.8 prerelease210905T104134ZJakque
035Vim210904T033001ZDLosc
045Python160109T125519ZSherlock
007Stax190930T174402Zrecursiv
023k4190930T172342Zscrawl
069Lua190922T140646ZMahmoud
036Haskell190929T211944Zxnor
00905AB1E legacy190930T074159ZDorian
046Mumps InterSystems190628T124212Zzmerch
041Befunge93190627T125949Znegative
043PHP r190625T105536ZShieru A
063Clojure190625T140843ZNikoNyrh
017APL Dyalog Classic190625T085536Zngn
048APLNARS190625T073844Zuser5898
169JavaScript190625T043015Zuser8748
012Husk190405T035613ZEsolangi
157Brainfuck190403T134856Zorthople
008Japt190401T212027ZShaggy
009Jelly190402T221651ZNick Ken
054PowerShell190402T080326Zmazzy
035Perl 6190402T030736ZJo King
048R190401T212343ZRobin Ry
014Gaia190401T203923ZGiuseppe
008Canvas190401T202955Zdzaima
032Mathematica160310T200902ZCalculat
037Haskell160109T174611Znimi
011Pyke160609T171009ZBlue
158Java 7160411T184251ZPoke
041Powershell160331T132536ZJonathan
028J160331T050036ZLeaky Nu
014MATL160110T053515ZLuis Men
219Java160311T051817ZJamesENL
017Japt160110T034136ZETHprodu
033Perl160110T032153Ztype_out
042JavaScript ES6160109T131359Zuser8165
571JavaScript160109T125324Znicael
054Matlab160109T154300Zflawr
018K5160109T153223ZJohnE
032Retina160109T124754ZMartin E
013Pyth160109T124330ZAdnan
059C#160109T133653ZLegionMa
01205AB1E160109T133049ZAdnan
038Ruby 1.9 and up160109T131927ZSherlock
044Python160109T130832ZSp3000
046Mathematica160109T125716ZLegionMa
011Pyth160109T125027Zorlp
014CJam160109T124009ZPeter Ta

Vyxal, 7 bytes

Eɽ2Ǒ›øA

Try it Online!

Eɽ      # 0...2^n inclusive
  2Ǒ    # number of times each can be divided by 2
    ›   # incremented, to start with 1 instead of 0
     øA # and get the corresponding letter for each
        # (output as a list of chars, joined into a single string)

Nibbles, 10 bytes

``;$$"A"::; @-$~+'A'@

Attempt This Online!

cQuents, 21 bytes

=@a:Z~hb$))~Z
=97:Z+1

Try it online!

Explanation

=@a:Z~hb$))~Z   first line
=@a             first term is "a"
   :            mode sequence: given input n, output the nth term
                    with no input, output the sequence indefinitely
                each term is 
    Z                        previous
     ~                                concat
      h   )                                  char(                              )
       b )                                         second line(               )
        $                                                       current index
           ~                                                                       concat
            Z                                                                             previous

=97:Z+1         second line
=97             first term is 97
   :            mode sequence: given input n, output the nth term
                each term is
    Z                        the previous term
     +                                         +
      1                                          1

Pip, 14 13 bytes

UaLaYPOzWR:yy

Attempt This Online!

Or, if 1-indexing is allowed, drop the Ua for 11 bytes: Attempt This Online!

Explanation

UaLaYPOzWR:yy
               ; z is lowercase alphabet; y is empty string (implicit)
Ua             ; Increment the command-line argument to get the indexing right
  La           ; and loop that many times:
     POz       ;  Pop the first character of z
        WR:y   ;  Wrap it in two copies of y
    Y          ;  Assign back to y
            y  ; After the loop, output the final value of y

Other 13 (or 11) byte solutions using different kinds of loops:

UaWaYyJWz@Day
UaFizHaYiWRyy

Rockstar, 80 bytes

1-indexed

listen to N
X's 0
O's ""
while N-X
cast X+97 in C
let O be+C+O
let X be+1

say O

Try it (Code will need to be pasted in)

Arturo, 48 bytes

f:$->x[(0=x)?->"a"->++++f x-1to :char x+97f x-1]

Try it!

f:$->x[               ; a function named f taking an argument x
    (0=x)?            ; is x zero?
    ->"a"             ; then return "a"
    ->                ; otherwise,
        ++++          ; append three things together
        f x-1         ; f(x-1)
        to :char x+97 ; x converted to character
        f x-1         ; f(x-1)
]                     ; end function

Vyxal, 61 bitsv2, 7.625 bytes

¤$(nøAȮW∑

Try it Online!

Uses 1-indexing.

Explained

Generated using Luminespire

¤$(nøAȮW∑
¤$         # Push an empty string under the input
  (        # For each n in the range [1, input]:
   nøA     #   Get the nth letter of the alphabet
      Ȯ    #   Push a copy of the item under the top of the stack. This leaves the stack as [already generated, new letter, already generated]
       W∑  #   Wrap and sum the stack

Thunno 2 J, 9 bytes

Oėıf2c;⁺Ä

Attempt This Online!

Port of emanresu A's Vyxal answer.

Explanation

Oėıf2c;⁺Ä  # Implicit input
O          # Push 2 ** input
 ė         # Push [1..that)
  ı   ;    # Map:
   f       #  Prime factors
    2c     #  Count 2s
       ⁺Ä  # Letter of alphabet
           # Implicit output

Knight (v2.0-alpha), 37 bytes

;=q+96=n+1P;=x"";W=n-nT=x++xA-q n xOx

Try it online!

Expanded

; = q (+ 96 (= n (+ 1 PROMPT)))
; = x ""
; WHILE (= n (- n TRUE))
    = x (+ (+ x (ASCII (- q n))) x)
: OUTPUT x

Labyrinth, 31 bytes

_-)"(;;
(. ?  {_
@  +}989
   1_

Try it online!

I feel like this can be rearranged to be golfier, but a better layout eludes me. I also have a cleaner 1-indexed version which has a higher ratio of walls. This uses xnor's method of repeatedly incrementing the string and interspersing with as.

jq, 51 bytes

[range(.)+97|[.]|implode]|reduce.[]as$i("a";.+$i+.)

Try it online!

My life has improved significantly since I found reduce in this language.

-16 bytes from ovs.

jq -r, 43 bytes

def f:.-1|[[97]][.+1]//f+[.+98]+f;f|implode

Try it online!


With the capitalization pattern from the example outputs, 58 bytes:

def f:[[65]][.]//([.-1|f[]%32+96,.+66]|.+.)[:-1];f|implode

Try it online!

def f:    ...       ;  define a filter named f
      [[65]][.]        base case, if the argument . is 0, return [65]
      //               otherwise
         .-1|f         call the filter recursively
         []%32+96      convert each codepoint to lower case
          ,.+66        append .+66 (. is now the filter argument -1)
         [ ... ]       collect all codepoints in an array
         |.+.          and repeat that array twice
         [:-1]         remove the last integer
f|implode              call the filter on the input and convert the result to a string

Python 3.8 (pre-release), 43 bytes

a=lambda n:'a'[n:]or(b:=a(n-1))+chr(97+n)+b

Try it online!

Vim, 35 bytes

:h<_
jjYZZpqqv|yPyl/<c-r>"
xq{Dddl@-@qD

Try it online!

Explanation

The buffer starts with a single line containing the input integer.

:h<_
jjYZZp

Yank the lowercase alphabet from the help file. Paste it on a new line below the integer, leaving the cursor on the first character of the second line.

qq

Start recording macro q. This will be our "loop."

v|y

Using visual mode, select everything from the current character to the beginning of the line, inclusive, and yank it. This leaves the cursor on the first character of the line.

P

Paste the yanked text to the left of the cursor. The cursor is now on the last of the pasted characters.

yl

Yank that character.

/<c-r>"
x

Find the next occurrence of the just-yanked character. Delete it.

q

Stop recording the macro. Conveniently, this first time through the macro has left the alphabet unchanged. The only effect is that the cursor has moved from the a to the b.

{Dddl

Go to the beginning of the buffer. Delete the contents of the first line (the input number). Then delete the (now-empty) first line. Move the cursor one character to the right so as to start on b.

@-@q

Execute the macro N times, where N is the number we just deleted.

D

Delete the unused remainder of the alphabet.


Normally, the @-@q idiom is fraught with peril if the number has a chance of being zero, because 0 is not a valid count in Vim; instead, it is treated as a separate command that move the cursor to the beginning of the line. However, in this particular case, an input of 0 is no problem at all:

@-

Move the cursor to the beginning of the line.

@q

Execute the macro once. Recall that executing the macro with the cursor on the a leaves the alphabet unchanged and the cursor on the b.

D

Delete everything to the end of the line--which leaves only the a, exactly the output we want.

Python, 62 54 46 45 bytes

I would like to think that this code can still be golfed down somehow.

Edit: Bug fix thanks to Lynn. -1 byte thanks to squid.

a=lambda n:n and a(n-1)+chr(97+n)+a(n-1)or'a'

Try it online!

Stax, 7 bytes

ö▬⌐ç╗à╢

Run and debug it

This uses 1-based indexing.

0-based indexing costs another byte

k4, 23 bytes

{.Q.a x{x,(1+|/x),x}/0}

      x{           }/0  / do {func} x times, passing output of last iteration as input (first input is 0)
          (1+|\x)       / 1 + max x
        x,       ,x     / join x either side
 .Q.a                   / index into alphabet

executed with inputs [0,4) we get:

  {.Q.a x{x,(1+|/x),x}/0}'[0 1 2 3]
("a";"aba";"abacaba";"abacabadabacaba")

Lua, 69 bytes

f=function(n)return n<1 and"a"or f(n-1)..string.char(97+n)..f(n-1)end

Try it online!



C++ (gcc), 58 53 bytes

string f(int n){return n--?f(n)+char(98+n)+f(n):"a";}

- 5 bytes saved by ceilingcat

Try it online!

Haskell, 36 bytes

tail.(iterate((:"a").succ=<<)"_a"!!)

Try it online!

This uses a different recursive method from most of the other answers. To get the next string in the sequence, we don't join two copies in the previous string with a new letter in between, but instead increment every letter and intersperse a's.

aba -> bcb -> abacaba

05AB1E (legacy), 9 bytes

AćsI£vDyý

Try it online!

Also runs with the new 05AB1E version.

code:

A       push the lowercase alphabet
ć       extract first character of that ["bcdefg....", "a"]
s       swap both strings ["a", "bcdefg...."]
I£      drop all letters of the alphabet after the index defined by input
v       for each character 
  D     duplicate last stack entry
  yý    join by current letter
        implicitly close for-loop and print top of stack

Mumps (InterSystems), 46 bytes

S Q="",A=65 R N F I=0:1:N{S Q=Q_$C(A+I)_Q} W Q

InterSystems' version of Mumps (some say M, InterSystems likes to call it "Cache Object Script") allows delineating loops with braces which helps keep things on a single line; GT.M would be a few characters longer.

Befunge-93, 41 bytes

1-011v $<
v::+&_:#^!_:1+v
>:0\:^,+"`"$%:<

Try it online!

Probably some room for improvement here.

Explanation

The sequence is generated using its recursive definition. First, we initialize the stack with the 4 values (1, input+2), (0, -1). Each pair (a, b) on the stack is an "instruction" used in generating the sequence, which, when executed, gets popped and does the following:

The top two items on the stack are continuously run as a sequence-building instruction until the program terminates.

Worth noting that &+ is used the first time around to get the input, as well as every subsequent time as a decrement (because when there is no more input, & returns -1)

PHP -r, 43 bytes

register_argc_argv must be enabled for this to work.

for($a=$b=a;$argv[1]--;$a.=++$b.$a);echo$a;

Try it online!

PHP, 51 bytes

An anonymous function that prints the output directly.

function($n){for($a=$b=a;$n--;$a.=++$b.$a);echo$a;}

Try it online!

Clojure, 63 bytes

#(loop[r""i 0](if(= i %)r(recur(str r(char(+ i 97))r)(inc i))))

APL (Dyalog Classic), 20 19 17 bytes

⎕a[¯1↓⊥¨⍨,⍳2,⎕⍴2]

Try it online!

yet another apl answer

APL(NARS), 24 chars, 48 bytes

{⍵<0:⍬⋄k,⎕A[⍵+1],k←∇⍵-1}

test:

  f←{⍵<0:⍬⋄k,⎕A[⍵+1],k←∇⍵-1}
  f 0
A
  f 1
ABA
  f 2
ABACABA
  f 3
ABACABADABACABA
  f 4
ABACABADABACABAEABACABADABACABA

JavaScript, 169 bytes

x=function(n){var r="";for(var i=1;i<=Math.pow(2,n)-1;i++){for(var j=i;j>=0;j--){if(!(i%Math.pow(2,j))){r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ".slice(0,n)[j];break;}}}return r;}

Try it online!

Live demo:

x=function(n){var r="";for(var i=1;i<=Math.pow(2,n)-1;i++){for(var j=i;j>=0;j--){if(!(i%Math.pow(2,j))){r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ".slice(0,n)[j];break;}}}return r;}

console.log(x(prompt("Input depth of ABACABA Pattern")))

Explanation:

x = function(n){ // created function, and yes, I omitted var
  var r = ""; // declaring variable to be returned
  for (var i = 1; i <= Math.pow(2, n) - 1; i++){ // this loop creates each letter in the pattern; "Math.pow(2, n) - 1" is the length of the pattern at depth n
    for (var j = i; j >= 0; j--){ // this loop finds the greatest power of 2 that i is divisible by, since that can be used to find the correct character for that index
      if (! (i % Math.pow(2, j) ) ){ // the modulo part checks the divisibility of 2^j; the "!" replaces "=== 0" 
        r += "ABCDEFGHIJKLMNOPQRSTUVWXYZ".slice(0,n)[j]; // appending character to r
        break; // exits loop once greatest power of 2 i is divisible by is found
      }
    }
  }
  return r;
}

Husk, 12 bytes

!¡S+oṠ:o→▲"a

Try it online!

Uses 1-based indexing, which I hope is OK.

Explanation

!             (                                          !!)
 ¡             iterate(                              )
  S                        <*>
   +                   (++)
    o                         (                     )
     Ṡ                         join$   .
      :                             (:)
       o                                    .
        →                               succ
         ▲                                   maximum
          "a                                          "a"

              (iterate((++)<*>(join$(:).succ.maximum))"a"!!)

Brainfuck, 157 bytes

,+>-[>++<-----]>----->>+<<<<[->>[[->>[>>>]<+<+<[<<<]>>[>>>]<]>>[>>>]<[-<<[<<<]>>[>>>]<+>>[>>>]<]+>+<<<[<<<]>>[>>>]+[>>>]<]<<<+>>[<-<<]<]>>>>[>>>]<<<<<<[<<.<]

Input is given in binary.

The basic idea is to repeatedly duplicate the current sequence (starting with "a") and to increment the last element after each iteration:

  1. a → aa → ab

  2. ab → abab → abac

  3. abac → abacabac → abacabac

  4. ...

When all of this has been done the specified amount of times, the result gets printed excluding the last element.

In-depth explanation

The memory is arranged in the following way:

.---------.-.-----.----.---.-----.----.---.---
|Countdown|0|Value|Copy|End|Value|Copy|End|...
'---------'-'-----'----'---'-----'----'---'---

            |--Element 1---|--Element 2---|

Countdown holds the number of copy cycles that are yet to be executed. The ABACABA sequence is stored in adjecent blocks, each made up of 3 cells. Value holds the character of the element (i.e. "A","B","C"...). The Copy flag indicates whether or not the corresponding element needs to be copied within the current copying cycle (0=copy, 1=don't). The End flag is set to 0 for the last element while it is being copied (it's 1 in all other cases).

Now to the actual (slightly ungolfed) program:

,                       read Countdown from input
+                       add 1 to avoid off-by-one error
>-[>++<-----]>-----     initialize value cell of first element to 97 ("a")
>>+                     set End flag of first element to 1
<<<<                    move to Countdown
[                       loop until Countdown hits 0 (main loop)
    -                   decrement Countdown
    >>                  move to Value cell of first element
    [                   copying loop
        [               duplication sub-loop
            -           decrement Value cell of the element to copy
            >>          move to End flag
            [>>>]       move to End flag of the last element
            <+<+        increment Copy and Value cell of last element (Copy cell is temporarily abused)
            <           move to End flag of second to last element
            [<<<]>>     move back to Copy cell of first element
            [>>>]<      move to Value cell of the first element where the Copy flag is 0
        ]
        >>[>>>]<        move to (abused) Copy flag of the last element
        [               "copy back" sub-loop
            -           decrement Copy flag
            <<          move to End flag of second to last element
            [<<<]>>     move back to Copy cell of first element
            [>>>]<      move to Value cell of the first element where the Copy flag is 0
            +           increment Value cell
            >>[>>>]<    move back to Copy flag of the last element
        ]
        +>+             set Copy and End flag to 1
        <<<             move to End flag of second to last element
        [<<<]>>         move back to Copy cell of first element
        [>>>]<          move to Value cell of the first element where the Copy flag is 0
        >+<             set Copy flag to 1
        >[>>>]<         move to Value cell of the next element to copy
    ]                   loop ends three cells behind the last "valid" Value cell
    <<<+                increment Value cell of last element
    >>                  move to End flag
    [<-<<]              reset all Copy flag
    <                   move to Countdown
]
>>>>                    move to End flag of first element
[>>>]<<<                move to End flag of last element                
<<<                     skip the last element
[<<.<]                  output Value cells (in reverse order, but that doesn't matter)

Japt, 8 bytes

;gCåÈ+iY

Try it

;gCåÈ+iY     :Implicit input of integer
 g           :Index into
; C          :  Lowercase alphabet
   å         :  Cumulatively reduce, with an initial value of an empty string
    +        :    Append a copy of the current value
     i       :    Prepended with
      Y      :    The current letter

Jelly, 9 bytes

‘R;ṭ¥/ịØa

Try it online!

It would be 8 were it not for the requirement for the sequence to start with zero = a.

PowerShell, 54 bytes

param($n)for(;$n+1){$d+=[char]($i+++97-32*!$n--)+$d}$d

Try it online!

Perl 6, 35 bytes

{('a',{$_~chr(++$+97)~$_}...*)[$_]}

Try it online!

R, 48 bytes

f=function(n)if(n)paste0(a<-f(n-1),letters[n],a)

Try it online!

Simple recursion.

Gaia, 14 bytes

₵aØ@⟪¤ṇ3ṁ¤+ṫ⟫ₓ

Try it online!

₵a		| Push lowercase alphabet
  Ø		| push lowercase string
   @         ₓ	| push the input and do everything between ⟪⟫ that many times
    ⟪¤		| swap
      ṇ		| take the last (first) character
       3ṁ	| push the 3rd item on the stack
         ¤+	| swap and concatenate
           ṫ⟫	| and palindromize

Canvas, 8 bytes

ø⁸╵zm{+│

Try it here!

7 bytes taking the index starting with 1, or hacky 6 bytes by taking input "with a trailing newline" (which together can sum up to 5 bytes)

Mathematica, 36 32 bytes

##<>#&~Fold~Alphabet[][[;;#+1]]&

Have you ever watched TWOW 11B?

Haskell, 39 37 bytes

a 0="a"
a n=a(n-1)++['a'..]!!n:a(n-1)

Usage example: a 3 -> "abacabadabacaba".

Edit: @Angs found two bytes to save. Thanks!

Pyke, 11 bytes (noncompeting)

G@QVk?tQG@:

Try it here!

G@          - s = alphabet[input]
  QV        - repeat input times:
     ?tQ    -   input -= 1
        G@  -  alphabet[^]
    k     : - s = s.replace("", ^)

Java 7, 158 bytes

class B{public static void main(String[]a){a('a',Byte.valueOf(a[0]));}static void a(char a,int c){if(c>=0){a(a,c-1);System.out.print((char)(a+c));a(a,c-1);}}}

I like to lurk around PPCG and I would enjoy being able to vote/comment on other answers.

Input is given as program parameters. This follows the same format as many other answers here in that it's a straight forward recursive implementation. I would have commented on the other answer but I don't have the rep to comment yet. It's also slightly different in that the recursive call is done twice rather than building a string and passing it along.

Powershell, 53,46,44,41 Bytes

1..$args[0]|%{}{$d+=[char]($_+96)+$d}{$d}

Pasting into console will generate erronous output on the second run since $d is not re-initialized.

Save 2 bytes by using += Save 3 bytes thanks to @TimmyD

J, 30 28 bytes (Try it online!)

I just found out that a(0) = "a", which chopped of 2 bytes.

u:97+(0:`($:@<:,],$:@<:)@.*)

Usage:

   u:97+(0:`($:@<:,],$:@<:)@.*) 2
abacaba

How it works:

u:97+(0:`($:@<:,],$:@<:)@.*) n NB. pseudocode:
                               NB. input as n
                               NB. function as generate_tree
u:                             NB.   convert_to_ASCII(
  97+                          NB.     add_to_all(97,
     (xx`yyyyyyyyyyyyyyy@.z)   NB.       if z then y or x:
                          *    NB.         z: n>0?
      0:                       NB.         x: 0
         ($:@<:,],$:@<:)       NB.         y:
          ppppp,q,rrrrr        NB.           concat(p,q,r):
          $:@<:                NB.             p:
          $:@                  NB.               generate_tree(
             <:                NB.                 n-1)
                ]              NB.             q: n
                  $:@<:        NB.             r: generate_tree(n-1)

MATL, 14 bytes

0i:"t@whh]97+c

This uses version 8.0.0 of the language/compiler, which is earlier than the challenge.

Example

>> matl
 > 0i:"t@whh]97+c
 >
> 3
abacabadabacaba

Explanation

The secuence is created first with numbers 0, 1, 2, ... These are converted to letters 'a', 'b', 'c' at the end.

0         % initiallize: a(0)
i:        % input "N" and create vector [1, 2, ... N]
"         % for each element of that vector
  t       % duplicate current sequence
  @       % push new value of the sequence
  whh     % build new sequence from two copies of old sequence and new value
]         % end for
97+c      % convert 0, 1, 2, ... to 'a', 'b', 'c'. Implicitly print

Edit

Try it online!

Java, 219 bytes

My first code golf attempt. Probably can be golf'd further, but I'm hungry and going out to lunch.

public class a{public static void main(String[]a){String b=j("a",Integer.parseInt(a[0]),1);System.out.println(b);}public static String j(String c,int d,int e){if(d>=e){c+=(char)(97+e)+c;int f=e+1;c=j(c,d,f);}return c;}}

Ungolfed:

public class a {
    public static void main(String[] a) {
        String string = addLetter("a", Integer.parseInt(a[0]), 1);
        System.out.println(string);
    }

    public static String addLetter(String string, int count, int counter) {
        if (count >= counter) {
            string += (char) (97 + counter) + string;
            int f = counter + 1;
            string = addLetter(string, count, f);
        }
        return string;
    }
}

Pretty straightforward brute force recursive algorithm, uses char manipulation.

Japt, 20 17 bytes

97oU+98 r@X+Yd +X

Test it online!

How it works

         // Implicit: U = input integer
65oU+66  // Generate a range from 65 to U+66.
r@       // Reduce each item Y and previous value X in this range with this function:
X+Yd     // return X, plus the character with char code Y,
+X       // plus X.

         // Implicit: output last expression

Non-competing version, 14 bytes

97ôU r@X+Yd +X

The ô function is like o, but creates the range [X..X+Y] instead of [X..Y). Test it online!

I much prefer changing the 97 to 94, in which case the output for 5 looks like so:

^_^`^_^a^_^`^_^b^_^`^_^a^_^`^_^c^_^`^_^a^_^`^_^b^_^`^_^a^_^`^_^

Perl, 33 bytes

map$\.=chr(97+$_).$\,0..pop;print

No real need for un-golfing. Builds the string up by iteratively appending the next character in sequence plus the reverse of the string so far, using the ASCII value of 'a' as its starting point. Uses $\ to save a few strokes, but that's about as tricky as it gets.

Works for a(0) through a(25) and even beyond. Although you get into extended ASCII after a(29), you'll run out of memory long before you run out of character codes:

a(25) is ~64MiB. a(29) is ~1GiB.

To store the result of a(255) (untested!), one would need 2^256 - 1 = 1.15x10^77 bytes, or roughly 1.15x10^65 1-terabyte drives.

JavaScript (ES6), 43 42 bytes

a=n=>n?a(--n)+(n+11).toString(36)+a(n):"a"

A byte saved thanks to @Neil!

Yet another simple recursive solution...

JavaScript, 65 571 bytes

n=>eval('s="a";for(i=0;i<n;i++)s+=(i+11).toString(36)+s')

Demo:

function a(n){
  return eval('s="a";for(i=0;i<n;i++)s+=(i+11).toString(36)+s')
}
alert(a(3))

1 - thanks Neil for saving 8 bytes

Matlab, 54 bytes

Just a straight forward recursive implementation.

function s=f(n);s='';if n>-1;k=f(n-1);s=[k,n+97,k];end

I first thought I could do better by using anonymous functions, but it turned out to be way longer, but I thougt I still share it:

i=@(b,c)c{2-b}();
a=@(n,f)i(n<0,{@()'',@()[f(n-1,f)),n+97,f(n-1,f)]});
ba=@(n)a(n,a);

K5, 18 bytes

"A"{x,y,x}/`c$66+!

Repeatedly apply a function to a carried value ("A") and each element of a sequence. The sequence is the alphabetic characters from B up to some number N (`c$66+!). The function joins the left argument on either side of the right argument ({x,y,x}).

In action:

 ("A"{x,y,x}/`c$66+!)'!6
("A"
 "ABA"
 "ABACABA"
 "ABACABADABACABA"
 "ABACABADABACABAEABACABADABACABA"
 "ABACABADABACABAEABACABADABACABAFABACABADABACABAEABACABADABACABA")

Retina, 37 32 bytes

$
aa
(T`_l`l`.$
)`1(a.*)
$1$1
z

The trailing linefeed is significant. Input is taken in unary.

Try it online!

Pyth, 14 13 bytes

Thanks to Jakube for saving a byte!

VhQ=+k+@GNk;k

A solution with 14 bytes: VhQ=ks[k@GNk;k.

Explanation:

VhQ=+k+@GNk;k

               # Implicit: k = empty string
VhQ            # For N in range input + 1      
   =           # Assign k
      +@GNk    # Position N at alphabet + k
    +k         # k + above
           ;   # End loop
            k  # Print k

Try it here!

C#, 59 bytes

string a(int n){return n<1?"a":a(n-1)+(char)(97+n)+a(n-1);}

Just another C# solution...

05AB1E, 12 bytes (non-competitive)

Code:

'aIGDN>.bsJl

I'll be damned. I fixed a lot of bugs thanks to this challenge haha.

Explanation:

'aIGDN>.bsJl

'a             # Push the character 'a'
  I            # User input
   G           # For N in range(1, input)
    D          # Duplicate the stack
     N         # Push N
      >        # Increment
       .b      # Convert to alphabetic character (1 = A, 2 = B, etc.)
         s     # Swap the last two elements
          J    # push ''.join(stack)
           l   # Convert to lowercase
               # Implicit: print the last item of the stack

Ruby (1.9 and up), 38 bytes

?a is a golfier way to write "a" but looks weird when mixed with ternary ?:

a=->n{n<1??a:a[n-1]+(97+n).chr+a[n-1]}

Python, 44 bytes

f=lambda n:"a"[n:]or f(n-1)+chr(97+n)+f(n-1)

Looks suspiciously might-be-golfable.

Mathematica, 46 bytes

If[#<1,"a",(a=#0[#-1])<>Alphabet[][[#+1]]<>a]&

Simple recursive function. Another solution:

a@0="a";a@n_:=(b=a[n-1])<>Alphabet[][[n+1]]<>b

Pyth, 11 bytes

u++GHG<GhQk

Simple reduction.

CJam (14 bytes)

'aqi{'b+1$++}/

Online demo